-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thasso Araújo
committed
May 18, 2020
1 parent
69ee0a9
commit 51a297e
Showing
4 changed files
with
1,403 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,23 @@ mongoose.connect('mongodb+srv:https://teste:[email protected]/t | |
useUnifiedTopology: true, | ||
}); | ||
|
||
/** | ||
* Routes | ||
*/ | ||
app.use(express.json()); | ||
app.use(routes); | ||
|
||
/** | ||
* Cors-Origin | ||
*/ | ||
app.use(cors()); | ||
app.use((req, res, next) => { | ||
res.header("Access-Control-Allow-Origin", "*"); | ||
res.header("Access-Control-Allow-Headers", "*"); | ||
|
||
app.use(cors()); | ||
|
||
return next(); | ||
}); | ||
|
||
/** | ||
* Routes | ||
*/ | ||
app.use(routes); | ||
|
||
app.listen(3333); |
Oops, something went wrong.