-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (33 loc) · 1.1 KB
/
index.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
const express = require('express')
const ejs = require('ejs')
const bodyParser = require('body-parser')
const cookieParser = require('cookie-parser')
const nunjucks = require('nunjucks')
const router = express.Router()
const app = express()
app.use(express.static('views'))
app.engine('html', ejs.renderFile)
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false}))
app.use(cookieParser())
nunjucks.configure('views', {
express: app,
noCache: true
})
const loginRoute = require('./routes/login')
const registerRoute = require('./routes/register')
const homeworkRoute = require('./routes/homework')
const videosRoute = require('./routes/videos')
const subjectsRoute = require('./routes/subjects')
const noteRoute = require('./routes/note')
const dbRoute = require('./routes/database')
app.use('/', loginRoute)
app.use('/register', registerRoute)
app.use('/tarefas', homeworkRoute)
app.use('/videos', videosRoute)
app.use('/materias', subjectsRoute)
app.use('/conceitos', noteRoute)
app.use('/database', dbRoute)
app.listen(3000, () => {
console.log('> Server running on port: 3000')
})