mirror of
https://github.com/FranP-code/open-react-blog-api.git
synced 2025-10-12 23:52:57 +00:00
CORS fix
This commit is contained in:
@@ -9,6 +9,10 @@ const port = process.env.PORT || 3000
|
||||
//Accept with JSON files
|
||||
server.use(express.json())
|
||||
|
||||
//Solve CORS problem
|
||||
const cors = require("cors")
|
||||
server.use(cors())
|
||||
|
||||
//Serve public for CSS files
|
||||
const path = require("path");
|
||||
server.use(express.static(path.resolve('public')));
|
||||
|
||||
Reference in New Issue
Block a user