Skip to content

Commit

Permalink
adding cors to get top participants endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmontano committed May 6, 2020
1 parent 4bbd8b1 commit 1bfa4ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 10 additions & 2 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 @@ -32,6 +32,7 @@
},
"dependencies": {
"axios": "^0.19.2",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"mongodb": "^3.5.7"
Expand Down
3 changes: 2 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import express from 'express';
import cors from 'cors';
import DatabaseClient from './database';

import ChatterService from './services/ChatterService';
Expand Down Expand Up @@ -48,7 +49,7 @@ setInterval(async () => {
}
}, 60 * 1000);

app.get('/', async (req, res) => {
app.get('/', cors(), async (req, res) => {
const participantsCollection = client.getCollection<Participant>(
'participants',
);
Expand Down

0 comments on commit 1bfa4ab

Please sign in to comment.