Moved cors to the routing-controller function

ref #4
This commit is contained in:
Nicolai Ort 2020-11-27 19:32:54 +01:00
parent 4e5e08483d
commit 24d890f638
2 changed files with 1 additions and 7 deletions

View File

@ -8,8 +8,8 @@ dotenvSafe.config();
const PORT = process.env.APP_PORT || 4010;
const app = createExpressServer({
controllers: [__dirname + "/controllers/*.ts"],
development: process.env.NODE_ENV === "production",
cors: true,
routePrefix: "/api",
controllers: [__dirname + "/controllers/*.ts"],
});

View File

@ -3,12 +3,6 @@ import bodyParser from 'body-parser';
import cors from 'cors';
export default async (app: Application) => {
app.get('/status', (req, res) => res.status(200).end());
app.enable('trust proxy');
app.use(cors());
// app.use(bodyParser.urlencoded({ extended: false }));
// more middlewares
return app;
};