Move CORS to apply to all routes
This commit is contained in:
14
app/CORSUnit.js
Normal file
14
app/CORSUnit.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const Unit = require('libflitter/Unit')
|
||||
const cors = require('cors')
|
||||
|
||||
class CORSUnit extends Unit {
|
||||
static get name() {
|
||||
return 'cors'
|
||||
}
|
||||
|
||||
async go(app) {
|
||||
app.express.use(cors())
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports = CORSUnit
|
||||
@@ -19,7 +19,7 @@ class IonicUnit extends Unit {
|
||||
}
|
||||
|
||||
async go(app) {
|
||||
app.express.use(cors())
|
||||
// app.express.use(cors())
|
||||
|
||||
app.express.use('/i', [
|
||||
this.canon.get('middleware::auth:UserOnly'),
|
||||
|
||||
Reference in New Issue
Block a user