Skip to content

Commit

Permalink
cors
Browse files Browse the repository at this point in the history
  • Loading branch information
orhankhanbayov committed Feb 15, 2023
1 parent b97fdc6 commit e3aef55
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 6 additions & 1 deletion api/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const express = require('express');
const path = require('path');
const logger = require('morgan');
const JWT = require('jsonwebtoken');
const cors = require('cors');

const postsRouter = require('./routes/posts');
const tokensRouter = require('./routes/tokens');
Expand All @@ -13,7 +14,11 @@ const commentRouter = require('./routes/comments');
const app = express();

app.use(express.json());

app.use(
cors({
origin: '*',
})
);
app.use(logger('dev'));
app.use(express.json());
app.use(express.static(path.join(__dirname, 'public')));
Expand Down
31 changes: 31 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
@@ -1,5 +1,8 @@
{
"devDependencies": {
"cypress-file-upload": "^5.0.8"
},
"dependencies": {
"cors": "^2.8.5"
}
}

0 comments on commit e3aef55

Please sign in to comment.