Skip to content

Commit

Permalink
fixed cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vova Stelmashchuk committed Aug 11, 2024
1 parent 7a5d4c5 commit 3132450
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require('dotenv').config();

const express = require('express');
const cors = require('cors');
const postListRoutes = require('./features/post-list/post-list-rest');
const postDetailsRoutes = require('./features/post-list/post-details-rest');
const cocktailDetails = require('./features/cocktail/rest');
Expand All @@ -8,6 +10,7 @@ const service = require('./features/service');
const app = express();
const port = process.env.APP_PORT;

app.use(cors());
app.use(express.json());

app.use(postListRoutes, postDetailsRoutes, cocktailDetails, service);
Expand Down
21 changes: 21 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "MIT",
"description": "",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.17.1",
"mongoose": "^5.12.3"
Expand Down

0 comments on commit 3132450

Please sign in to comment.