Microservice for queue
All API calls needs an Authorization header with valid jwt
$ curl -X GET -H "Authorization: Bearer <token>" https://queue.service.io/queue/next
Add a new document to the queue
$ curl -X PUT -H "Authorization: Bearer <token>" --header "Content-Type: application/json" -d '{ "title": "Hello", "description": "World!" }' https://queue.service.io/queue
Get next document from queue
$ curl -X GET -H "Authorization: Bearer <token>" https://queue.service.io/queue/next
Get all documents in queue
$ curl -X GET -H "Authorization: Bearer <token>" https://queue.service.io/queue/all
Deletes document from queue
$ curl -X DELETE -H "Authorization: Bearer <token>" https://queue.service.io/queue/5af938ee51450ae8f3b17e5f
You'll need the now-cli installed
- clone the repo
- install dependencies
- add a
.env
file - start the service with now-dev
$ now dev
.env
NODE_ENV=development
MONGODB_CONNECTION=connection-to-a-mongodb-compatible-api
MONGODB_COLLECTION=notes
MONGODB_NAME=secure-queue
JWT_SECRET=whatever-you-want
PAPERTRAIL_HOST=does-not-matter-in-dev-mode
PAPERTRAIL_PORT=does-not-matter-in-dev-mode
PAPERTRAIL_HOSTNAME=does-not-matter-in-dev-mode
Change content of now.json to match your environment.
Deploy service.
$ npm run deploy