add body-parser middleware to server

pull/29/head
Matthew 2020-09-29 02:44:12 -04:00
parent 8b0a2e7f93
commit 8e2c1c1b28
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import express from 'express'; import express from 'express';
import bodyParser from 'body-parser';
import helmet from 'helmet'; import helmet from 'helmet';
import { promises as fs } from 'fs';
import { Server as HTTPServer } from 'http'; import { Server as HTTPServer } from 'http';
import { Collection, ServerManagement, Route } from '.'; import { Collection, ServerManagement, Route } from '.';
@ -51,6 +51,7 @@ export default class Server {
public init() { public init() {
this.app.set('trust proxy', 'loopback'); this.app.set('trust proxy', 'loopback');
this.app.use(bodyParser.json());
this.app.use(helmet({ this.app.use(helmet({
hsts: false, hsts: false,
hidePoweredBy: false, hidePoweredBy: false,