Skip to content

Commit

Permalink
replace deprecated bodyParser ctor (nightscout#6819)
Browse files Browse the repository at this point in the history
Co-authored-by: Sulka Haro <sulka@sulka.net>
  • Loading branch information
2 people authored and lpsuerj committed Apr 17, 2021
1 parent 8a4d4f6 commit ebe5c12
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function create (env, ctx) {
, reportOnly: secureCspReportOnly
};
}


console.info('Enabled SECURE_HSTS_HEADER (HTTP Strict Transport Security)');
const helmet = require('helmet');
Expand Down Expand Up @@ -247,17 +247,11 @@ function create (env, ctx) {

app.use("/clock", clockviews);

app.use('/api', bodyParser({
limit: 1048576 * 50
}), apiRoot);
app.use('/api', bodyParser.json({limit: '50mb'}), apiRoot);

app.use('/api/v1', bodyParser({
limit: 1048576 * 50
}), api);
app.use('/api/v1', bodyParser.json({limit: '50mb'}), api);

app.use('/api/v2', bodyParser({
limit: 1048576 * 50
}), api);
app.use('/api/v2', bodyParser.json({limit: '50mb'}), api);

app.use('/api/v2/properties', ctx.properties);
app.use('/api/v2/authorization', ctx.authorization.endpoints);
Expand Down

0 comments on commit ebe5c12

Please sign in to comment.