-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
38 lines (26 loc) · 1.34 KB
/
server.js
File metadata and controls
38 lines (26 loc) · 1.34 KB
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
31
32
33
34
35
36
37
38
var express = require('express');
var app = express();
var http = require('http')
.Server(app);
// fs.readFile('package.json', function (err, data) {
// console.log('FILEDATA is ', data.toString());
// return data;
// });
// app.get('/', function (req, res) {
// res.send('<h1>Hello world</h1>');
// });
app.get('/', express.static(__dirname +'/www/' /*, { maxAge: oneDay }*/ ));
app.use('/static', express.static(__dirname + '/www/static' /*, { maxAge: oneDay }*/ ));
app.use('/node_modules', express.static(__dirname + '/www/node_modules' /*, { maxAge: oneDay }*/ ));
app.use('/DIYDM', express.static(__dirname +'/www/diydm/' /*, { maxAge: oneDay }*/ ));
app.use('/DIYDM/static', express.static(__dirname + '/www/diydm/static' /*, { maxAge: oneDay }*/ ));
app.use('/DIYDM/node_modules', express.static(__dirname + '/www/diydm/node_modules' /*, { maxAge: oneDay }*/ ));
var oneDay = 86400000;
//app.use(express.compress());
// console.log('Routes are :');
// console.log('/sfui/composer\t\t=\t'+ __dirname +'/clients/sfui-composer');
// console.log('/sfui/demos/calculator\t=\t'+__dirname + '/clients/demos/calculator');
// app.use('/demos/calculator', express.static(__dirname + '/www/demos/calculator' /*, { maxAge: oneDay }*/ ));
http.listen(process.env.PORT || 5000, function () {
console.log('listening on port ',process.env.PORT || '5000');
});