-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
85 lines (74 loc) · 2.21 KB
/
server.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Require modules
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var fs = require('fs');
//
io = require('socket.io').listen(server, { log: true });
//
// Start node HTTP server
port = process.env.PORT || 5555
if (server.listen(port))
console.log("...server up on " + port + "!");
rootPath = './pub/';
app.get('/', function (req, res) {
res.sendfile(rootPath + 'index.html');
});
app.get('/pde/*.pde', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/mobile', function(req,res)
{
res.sendfile(rootPath + '/noola/app.html');
});
app.get('/mm', function (req, res) {
res.sendfile(rootPath + 'mm.html');
});
app.get('/lib/*.js', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/lib/vendor/*.js', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/js/*.js', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/json/*.json', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/ico/*.ico', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/mp3/*.mp3', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/ttf/*.ttf', function (req, res) {
res.sendfile(rootPath + req.url);
})
app.get('/favicon.ico', function (req, res) {
res.sendfile(rootPath + '/ico/favicon.ico');
});
app.get('/img/*.(gif|png|jpg)', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/css/*.(css|png)', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/skins/[A-Za-z0-9]+/css/*.css', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/skins/[A-Za-z0-9]+/json/*.json', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/skins/[A-Za-z0-9]+/img/buttons/*.(gif|png|jpg)', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/skins/[A-Za-z0-9]+/img/*.(gif|png|jpg)', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/style/*.(css|png)', function (req, res) {
res.sendfile(rootPath + req.url);
});
app.get('/doc/*.(html)', function (req, res) {
res.sendfile(rootPath + req.url);
});