forked from binary-com/mobile
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (22 loc) · 827 Bytes
/
server.js
File metadata and controls
30 lines (22 loc) · 827 Bytes
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
27
28
29
30
// var express = require('express'),
// app = express();
// app.use(express.static('www'));
// app.set('port', process.env.PORT || 5000);
// app.listen(app.get('port'), function () {
// console.log('Express server listening on port ' + app.get('port'));
// });
var express = require('express'),
app = express();
app.use(express.static('www'));
// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
// API Routes
// app.get('/blah', routeHandler);
app.set('port', process.env.PORT || 5000);
app.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});