Skip to content

telemark/minelev-logs

Repository files navigation

Build Status js-standard-style

minelev-logs

logs service for minelev

API

All API calls needs an Authorization header with valid jwt

PUT /loqs

Add a new log

GET /loqs/:id

Get a spesific log

DELETE /loqs/:id

Deletes a spesific log

POST /logs/search

Search logs

POST /loqs/:id/status

Update a logs list of statuses

GET /queue/next

Get next log from queue

DELETE /queue/:id

Deletes log from queue

GET /queue/count

Get number of logs in queue

GET /classes/:schoolId

Get all classes for schoolId

GET /ping

Pong!

Development

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=logs
MONGODB_NAME=minelev
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

Deploy

This service is created to run on the ZEIT/Now serverless infrastructure.

Make sure the settings in now.json matches your environment.

Run the deploy script.

$ npm run deploy

or to deploy the demo version

$ npm run deploy-demo

Related

License

MIT