forked from pilsa0327/etherscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·52 lines (34 loc) · 1.15 KB
/
app.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
const express = require('express');
const app = express();
const session = require('express-session')
const logger = require('morgan');
const bodyParser = require('body-parser');
const errRouter = require('./routes/error');
const indexRouter = require('./routes/index');
const blockRouter = require('./routes/block');
const txRouter = require('./routes/tx');
const addressRouter = require('./routes/address');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(session({
secret: 'keyboard cat',
resave: false,
saveUninitialized: true
}))
app.use('/public', express.static(__dirname + "/public"));
app.set('view engine', 'ejs');
app.set('views', __dirname + '/views');
app.use(logger('dev'));
app.use('/', indexRouter);
app.use('/block', blockRouter);
app.use('/tx', txRouter);
app.use('/address', addressRouter);
app.use('/error', errRouter);
// app.use(function(req, res, next) {
// const web3 = global.web3;
// res.send(web3)
// })
app.use(function(req, res, next) {
res.status(404).send('Sorry cant find that!');
});
module.exports = app;