Sign inSign up

ulisesgascon/simple-api

By ulisesgascon

โ€ขUpdated almost 3 years ago

A very simple HTTP API to build fast prototypes

Image
0

4.6K

ulisesgascon/simple-api repository overview

โ  @ulisesgascon/simple-api

A very simple HTTP API to build fast prototypes

โ About

A very simple HTTP API to build fast prototypes

โ โค๏ธ Awesome Features:

  • Typical Sample API with all the expected things (cors, fast response, immutability, etc..) ๐Ÿšฉ
  • Basic JSON storage without external dependencies or third party solutions ๐Ÿ”ฅ
  • Great testing coverage ๐Ÿงช
  • Easy to customize โš™๏ธ
  • Great Documentation with Swagger ๐Ÿ“š
  • Available as Npx, module, docker image and more... with a single command ๐Ÿ“ฆ

โ Available Routes

Important:

  • By running npm run sample:generate you will regenerate a new TODOs dataset
  • The server allows CRUD Operations but this operations are not affecting the dataset at all

Endpoints:

  • GET /__/health check health
  • GET /__/docs Swagger documentation for all the available endpoints
  • GET /v1/todos List all TODOS
  • POST /v1/todos Create a TODO
  • GET /v1/todo/{id} Get a specific TODO
  • PUT /v1/todo/{id} Update a specific TODO
  • PATCH /v1/todo/{id} PAtch a specific TODO property
  • DELETE /v1/todo/{id} Delete a specific TODO

PRO TIP Run simple-api and check the Swagger docs with payload details and great UI ๐Ÿฟ

โ Usage

โ Docker Version ๐Ÿณ

Use Docker Hub:

# Pull the image from Docker Hub:
docker pull ulisesgascon/simple-api:latest

# Run container:
docker run -p 3000:3000 ulisesgascon/simple-api:latest

To build and run the container locally:

# Clone Repo:
git clone https://github.com/ulisesgascon/simple-api.git

# Change to repo's cloned directory:
cd simple-api

# Build Image locally:
docker build --no-cache -t ulisesgascon/simple-api:latest .

# Run container:
docker run -p 3000:3000  ulisesgascon/simple-api:latest

Tag summary

Content type

Image

Digest

sha256:2d9477a7cโ€ฆ

Size

68.8 MB

Last updated

almost 3 years ago

docker pull ulisesgascon/simple-api