Skip to content

Commit

Permalink
chore: add origin and credentials for cors
Browse files Browse the repository at this point in the history
  • Loading branch information
iZooGooD committed Feb 12, 2024
1 parent ef31ff8 commit d1d3f1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ const __dirname = path.dirname(__filename);
app.use(logger('dev'));
app.use(express.json());
// remove later for prod build
app.use(cors());
app.use(
cors({
origin: 'http://localhost:3000', // port for react app
credentials: true,
})
);
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, '../public')));
Expand Down

0 comments on commit d1d3f1c

Please sign in to comment.