Update: Add Access Controls
This commit is contained in:
parent
68e212fce9
commit
7a9ee00eb5
1 changed files with 8 additions and 0 deletions
|
|
@ -3,6 +3,14 @@ const app = express();
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
|
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
|
|
||||||
|
app.use(function(req, res, next) {
|
||||||
|
res.header("Access-Control-Allow-Origin", 'https://admin-polynotfound.herokuapp.com');
|
||||||
|
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||||
|
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: 'https://admin-polynotfound.herokuapp.com',
|
origin: 'https://admin-polynotfound.herokuapp.com',
|
||||||
credentials: true
|
credentials: true
|
||||||
|
|
|
||||||
Reference in a new issue