-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-server.js
82 lines (57 loc) · 1.92 KB
/
ui-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
/* This is the entry point for all web requests
* This will deal with handling the distrobution of requests to the static file server or api
*/
var express = require('express'); // call express
var app = express(); // define our app using express
var path = require('path');
var exphbs = require('express-handlebars');
var port = process.env.PORT || 3001;
var taglines = require('./utilities/taglines.js');
//db connections: n n
app.use(express.static(path.join(__dirname,'static')));
//================================= Templating Engine https://www.npmjs.com/package/express-handlebars
var hbs = exphbs.create({
layoutsDir: 'views/layouts/',
partialsDir: 'views/components/',
defaultLayout: 'default',
extname: '.hbs'
});
app.engine('hbs', hbs.engine);
app.set('view engine', 'hbs');
//================================= Routes
var uiRouter = express.Router();
uiRouter.get('/', function(req, res){
res.render('home', {
title: 'Wikilogic',
tagline: taglines.giveMeOne,
data: {}
});
});
uiRouter.get('/lang', function(re, res){
res.render('lang', {
title: 'Wikilogic',
tagline: 'Rational exploration.',
data: {}
});
});
uiRouter.get('/alchemy', function(req, res){
res.render('alchemy', { title: 'Hey', message: 'Hello there!' });
});
uiRouter.get('/d3', function(req, res){
res.render('d3', { title: 'Hey', message: 'Hello there!' });
});
uiRouter.get('/d3v4', function(req, res){
res.render('d3v4', { title: 'Hey', message: 'Hello there!' });
});
uiRouter.get('/statistics', function(re, res){
});
uiRouter.get('/claim-detail/:id', function(re, res){
});
uiRouter.get('/work-space/:id', function(re, res){
});
uiRouter.get('/my-profile', function(re, res){
});
app.use('/', uiRouter);
//================================= Begin
app.listen(port);
console.log('http://localhost:' + port);