Enable CORS (for @cppchedy)

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent 2955533c80
commit 060151db13

@ -405,6 +405,11 @@ function ApiHandler(compileHandler) {
this.compilers = compilers;
};
this.handler = express.Router();
this.handler.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
this.handler.get('/compilers', _.bind(function (req, res, next) {
if (req.accepts(['text', 'json']) == 'json') {
res.set('Content-Type', 'application/json');

Loading…
Cancel
Save