-
Notifications
You must be signed in to change notification settings - Fork 1
/
web.js
45 lines (36 loc) · 1.16 KB
/
web.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
#!/usr/bin/env node
/*
* DataHero File Upload Plugin based on jQuery File Upload plugin
* https://github.com/jinglundong/DataHero-File-Upload-.git
*
* Author: Jinglun Dong. October 27, 2012.
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
//web server:
(function (port){
var express = require('express');
var app = express();
// Configuration
app.set("view options", {layout: false});
app.engine('html', require('ejs').renderFile);
app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
app.use(express.errorHandler());
});
app.use("/css", express.static(__dirname + '/views/css'));
app.use(express.static(__dirname + '/views'));
app.get('/', function(req, res){
res.render(__dirname + "/views/index.html");
});
app.get('/index', function(req, res){
res.render(__dirname + "/views/index.html");
});
app.get('/browse', function(req, res){
res.render(__dirname + "/views/browse.html");
});
app.listen(port);
}(8080));