-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
57 lines (41 loc) · 1.45 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
var express = require('express')
, path = require('path')
, routes = require('./routes')
//, OAuth = require('./lib/oauth')
, host = process.env.IP || 'localhost'
, port = process.env.PORT || 8080;
//var app = express()
var express = require('express');
var app = module.exports = express();
// create an error with .status. we
// can then use the property in our
// custom error handler (Connect repects this prop as well)
function error(status, msg) {
var err = new Error(msg);
err.status = status;
return err;
}
// setup EJS view engine
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
/*
app.configure(function(){
app.use(express.urlencoded());
// add session
//app.use(express.cookieParser('somethingsupersecret'));
//app.use(express.session());
// serve static files
app.use(express.static(path.join(__dirname, 'public')));
});
*/
// the root maps to the index of routes in /routes folder
app.get('/foafiaf/', routes.index);
// the foafiaf/map path routes to the foafiaf_map.js in /routes folder
app.get('/foafiaf/map', routes.foafiaf_map);
app.get('/foafiaf/megraph', routes.megraph_map );
app.get('/foafiaf/projects', routes.projects_map );
app.get('/foafiaf/importexport', routes.importexport );
app.get('/foafiaf/combine', routes.combine_JSONLDfiles );
app.listen(port, host);
console.log('Listening on port http://' + host + ':' + port);