Description
Nest framework TypeScript starter repository.
Installation
$ npm install
Running the app
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Test
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
API
NOTES:
- TTL should be passed via headers (x-ttl) and must be milliseconds (1000 = 1s) except setting values for multiple keys
- Get the list of all keys
GET /storage/list
- Get the value for key
GET /storage/keys/:id
- Get the ttl value for key
GET /storage/keys/:id/ttl
- Set the value for key
PUT /storage/keys/:id
, payload -> value - Set the ttl value for existing key
PUT /storage/keys/:id/ttl
, no payload needed - Get values for multiple keys
GET /storage/mkeys?ids[]=key1&ids[]=key2
- Set values for multiple keys
PUT /storage/mkeys
. payload must be[ { key: 'string', value: any, ttl?: number } ]
- Delete value for the key
DELETE /storage/keys/:id
- Delete values for multiple key
DELETE /storage/mkeys?ids[]=key1&ids[]=key2
- Delete values for all key
DELETE /storage/flush