Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Put CORS in handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jul 21, 2019
1 parent 579c37e commit 1048d40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart-manager",
"version": "1.0.86",
"version": "1.0.87",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion setup/internal/staart-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.86
1.0.87
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export class Staart extends Server {
super();
this.setupHandlers();
this.setupControllers();
this.app.use(errorHandler);
if (!DISALLOW_OPEN_CORS) this.app.use(cors());
if (!DISALLOW_OPEN_CORS) this.app.use(errorHandler);
}

private setupHandlers() {
this.app.use(cors());
this.app.use(helmet({ hsts: { maxAge: 31536000, preload: true } }));
this.app.use(morgan("combined", { stream: accessLogStream }));
this.app.use(json({ limit: "50mb" }));
Expand Down

0 comments on commit 1048d40

Please sign in to comment.