add body-parser middleware to server
parent
8b0a2e7f93
commit
8e2c1c1b28
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue