forked from ShortCircuits/nightly-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
24 lines (18 loc) · 658 Bytes
/
Copy pathserver.js
File metadata and controls
24 lines (18 loc) · 658 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
var express = require('express'),
app = express();
// app.get('/', function (req, res) {
// { GOOGLE_API_KEY: process.env.GOOGLE_API_KEY }
// })
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'));
});