-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
28 lines (21 loc) · 623 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var express = require('express');
//var cors = require('cors')
var app = express();
// in NodeJS/Express (server)
/*
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
// intercept OPTIONS method
if ('OPTIONS' == req.method) {
res.send(200);
}
else {
next();
}
};
app.use(allowCrossDomain);
*/
app.use(express.static(__dirname + '/app'));
app.listen(process.env.PORT || 3000);