diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e7f333f36e4abbd1d63e05d91376227e51955e99 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# api-ttl-lifo-express +Work with stack and data with support TTL + +# Technologies +Node.js, keeping data in stack type and with supporting of TTL + +# Run server locally +Clone this repo. +* Define .env file in the root of project and variables (below default values which will run automatically): + * PORT=3000 + * NODE_ENV=dev + * TTL_EXPIRATION=30 + * SERVICE_NAME=ttl-lifo + * TTL_EXPIRATION=30 + +### npm i +For installing packages + +### npm run start:dev +Run server with live-reload + +### npm start +Run server + +### npm run test +Running tests + +## Available endpoints +* Stack data + * POST localhost:3000/stack - *add data to stack* + * body { "data": any } + * GET localhost:3000/stack - *get last item from stack and remove* +* TTL data + * GET localhost:3000/ttl/:key - *get item by key* + * POST localhost:3000/ttl - *add item* + * body { "key": string; "value": any } + * DELETE localhost:3000/ttl/:key - *remove item by key*