Skip to content

Commit

Permalink
(fix) cors
Browse files Browse the repository at this point in the history
  • Loading branch information
NemesisX1 committed Oct 17, 2023
1 parent 62b2bf6 commit 689a8a7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
68 changes: 68 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"dependencies": {
"@types/jest": "^29.5.5",
"cookie-parser": "~1.4.4",
"cors": "^2.8.5",
"debug": "~2.6.9",
"dotenv": "^16.0.0",
"express": "~4.16.1",
"express-validator": "^7.0.1",
"helmet": "^7.0.0",
"html-to-text": "^9.0.5",
"http-errors": "~1.6.3",
"http-status-codes": "^2.3.0",
Expand All @@ -35,6 +37,7 @@
"@jest/globals": "^29.7.0",
"@tsconfig/node16": "^1.0.0",
"@types/cookie-parser": "^1.4.2",
"@types/cors": "^2.8.14",
"@types/debug": "^4.1.7",
"@types/express": "^4.17.13",
"@types/http-errors": "^1.8.1",
Expand Down
5 changes: 4 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import express, { RequestHandler, ErrorRequestHandler } from 'express';
import path from 'path';
import cookieParser from 'cookie-parser';
import logger from 'morgan';

import cors from "cors";
import helmet from 'helmet';
import indexRouter from './routes/index';
import theatersRouter from './routes/theaters';

Expand All @@ -25,6 +26,8 @@ class App {
this.app.set('view engine', 'jade');

this.app.use(logger('dev'));
this.app.use(cors());
this.app.use(helmet());
this.app.use(express.json());
this.app.use(express.urlencoded({ extended: false }));
this.app.use(cookieParser());
Expand Down

0 comments on commit 689a8a7

Please sign in to comment.