-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (29 loc) · 762 Bytes
/
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
const express = require('express')
const cors = require('cors')
const nunjucks = require('nunjucks')
const app = express()
const PORT = process.env.PORT || 3069
nunjucks.configure('html', {
autoescape: true,
express: app
})
app.use(cors())
app.use(
express.urlencoded({
extended: true
})
)
app.use(express.json())
app.engine('html', nunjucks.render)
app.set('view_engine', 'html')
var index = require('./api/index')
var webnovel = require('./api/webnovel')
app.use('/', index)
app.use('/webnovel', webnovel)
app.use(express.static('css'))
app.use(express.static('js'))
app.use("/fonts", express.static('./fonts'))
var ip = "0.0.0.0"
app.listen(PORT, () => {
console.log(`The Server is running at: http://localhost:${PORT}/`)
})