# 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 * API_SWAGGER_ENABLED=1 * API_SWAGGER_URL=api-docs ### 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 You can use all endpoints via Swagger http://localhost:3000/api-docs * 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, "expirationSeconds": number (optional) } * DELETE localhost:3000/ttl/:key - *remove item by key*