Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function create (env, ctx) {
, app = express( )
;

var wares = require('../middleware/')(env);
const wares = ctx.wares;

// set up express app with our options
app.set('name', env.name);
Expand Down
7 changes: 7 additions & 0 deletions lib/api/notifications-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ function configure (app, ctx) {
, api = express.Router( )
;

api.use(ctx.wares.compression());
api.use(ctx.wares.rawParser);
api.use(ctx.wares.bodyParser.json({
limit: '50Mb'
}));
api.use(ctx.wares.urlencodedParser);

api.post('/loop', ctx.authorization.isPermitted('notifications:loop:push'), function (req, res) {
ctx.loop.sendNotification(req.body, req.connection.remoteAddress, function (error) {
if (error) {
Expand Down
2 changes: 2 additions & 0 deletions lib/server/bootevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ function boot (env, language) {
, levels: ctx.levels
}).registerServerDefaults();

ctx.wares = require('../middleware/')(env);

ctx.pushover = require('../plugins/pushover')(env, ctx);
ctx.maker = require('../plugins/maker')(env);
ctx.pushnotify = require('./pushnotify')(env, ctx);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightscout",
"version": "14.2.3",
"version": "14.2.4",
"description": "Nightscout acts as a web-based CGM (Continuous Glucose Montinor) to allow multiple caregivers to remotely view a patients glucose data in realtime.",
"license": "AGPL-3.0",
"author": "Nightscout Team",
Expand Down