Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

telemark/minelev-notifications

Repository files navigation

Build Status js-standard-style

minelev-notifications

Notifications for MinElev

API

All API calls needs an Authorization header with valid jwt

POST /warnings

POST a generated warning from MinElev. This service will notify contact teachers if one of their students has received a warning.

See example data in test/data/warning.json

Returns

{
  success: true,
  notifications: '<number-of-notifications>',
  logs: ['log-from-each-notification']
}

POST /yff

POST a generated yff notification from MinElev-saksbehandler-robot. This service will send emails to the persons specified in the "copy to" field.

See example data in test/data/yff.json

Returns

{
  success: true,
  log: ['log-from-notification']
}

Development

Add a local .env file

NODE_ENV=development
JWT_SECRET=jwt-secret
MINELEV_URL=url-to-minelev
BUDDY_SERVICE_URL=buddy-service-url
MAIL_SERVICE_URL=maiul-service-url
MAIL_SERVICE_SECRET=mail-service-secret
MAIL_TEMPLATE_NAME=mail-service-template-name
PAPERTRAIL_HOSTNAME=minelev
PAPERTRAIL_HOST=logs.papertrails.com
PAPERTRAIL_PORT=12345

Run the dev script

$ now dev

Deploy to ZEIT/Now - Manually

Configure now.json

Run the deployscripts

$ npm run deploy:test
$ npm run deploy:prod

Deploy to ZEIT/Now - Automatically

Configure now.json and GitHub actions

Do a release

Related

License

MIT