-
Notifications
You must be signed in to change notification settings - Fork 0
/
bs-config1.js
98 lines (81 loc) · 2.52 KB
/
bs-config1.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
86
87
88
89
90
91
92
93
94
95
96
97
98
var express = require('express');
var app = express();
const ejs = require("ejs");
app.use(express.static(('public')));
//app.use(express.static('public'));
app.use(express.urlencoded({extended: true}));
var session = require('express-session');
var express = require('express');
//var bodyParser = require('body-parser');
app.use(express.json());
app.use(express.urlencoded({
extended: true
}));/*
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());*/
// fetching table
var path = require('path');
app.set('views', path.join(__dirname, '/src/views'));
app.set('view engine', 'ejs');
app.use(express.static('src'));
// app.use('/css',express.static(__dirname + 'src/css'))
// web-portion --------------------------------->
app.use(session({
secret: '123456cat',
resave: false,
saveUninitialized: true,
cookie: { maxAge: 60000*300 }
}))
var FirstPage = require('./routes/first_page');
var registrationRouter = require('./routes/registration-route');
var loginRouter = require('./routes/login-route');
var dashboardRouter = require('./routes/dashboard-route');
var logoutRouter = require('./routes/logout-route');
var RegisterRouter = require('./routes/main');
var AdminLogin = require('./routes/admin_login');
var Tableview = require('./routes/table_view');
app.use('/', registrationRouter);
app.use('/', loginRouter);
app.use('/', dashboardRouter);
app.use('/', logoutRouter);
app.use('/',RegisterRouter);
// app.use('/',FirstPage);
app.use('/',AdminLogin);
app.use('/',Tableview);
// web-portion --------------------------------->
app.get('/vote_area', function (req, res) {
res.sendFile( __dirname + "/src/vote_area.html" );
})
app.get('/candidateDetails', function (req, res) {
res.sendFile( __dirname + "/src/adminCandidateDetails.html" );
})
app.get('/userInfo', function (req, res) {
res.sendFile( __dirname + "/src/userInfo.html" );
})
app.get('/result', function (req, res) {
res.sendFile( __dirname + "/src/result.html" );
})
app.get('/addCandidate', function (req, res) {
res.sendFile( __dirname + "/src/adminAddCandidate.html" );
})
app.get('/changePhase', function (req, res) {
res.sendFile( __dirname + "/src/adminChangePhase.html" );
})
app.get('/voting', function (req, res) {
res.sendFile( __dirname + "/src/voting.html" );
})
app.get('/hello', function (req, res) {
res.send('hello');
})
module.exports = {
"server": {
"baseDir": ["./src", "./build/contracts"],
"routes": {
"/vendor": "./node_modules"
},
middleware: {
1: app,
},
},
port:3000,
};