mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 04:48:32 +03:00
add cors in development
This commit is contained in:
@@ -8,6 +8,13 @@ import config from './config'
|
||||
let app = express()
|
||||
app.server = http.createServer(app)
|
||||
|
||||
// enable cross origin requests explicitly in development
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const cors = require('cors')
|
||||
console.log('Enabling CORS in development...')
|
||||
app.use(cors())
|
||||
}
|
||||
|
||||
initialize(controller => {
|
||||
app.use(
|
||||
middleware({
|
||||
|
||||
Reference in New Issue
Block a user