2024-10-05 20:50:29 -04:00
|
|
|
const express = require('express')
|
|
|
|
const app = express()
|
|
|
|
const port = 3003
|
2024-10-06 00:48:04 -04:00
|
|
|
const serveIndex = require('serve-index')
|
2024-10-09 02:12:54 -04:00
|
|
|
const {engine} = require('express-handlebars')
|
|
|
|
const indexRouter = require('./src/router/indexRouter')
|
2024-10-06 00:48:04 -04:00
|
|
|
|
|
|
|
const publicPath = "/public"
|
|
|
|
const inUrlPath = "public"
|
2024-10-05 20:50:29 -04:00
|
|
|
|
|
|
|
|
2024-10-09 02:12:54 -04:00
|
|
|
app.engine('.hbs', engine({extname: '.hbs'}));
|
|
|
|
app.set('view engine', '.hbs');
|
|
|
|
|
2024-10-06 00:48:04 -04:00
|
|
|
app.use(publicPath, express.static(inUrlPath), serveIndex(inUrlPath, {
|
|
|
|
icons: true
|
|
|
|
}))
|
2024-10-05 20:50:29 -04:00
|
|
|
|
|
|
|
app.listen(port, () => {
|
|
|
|
console.log(`Listening on port ${port}`)
|
|
|
|
})
|
2024-10-09 02:12:54 -04:00
|
|
|
|
|
|
|
app.use('/', indexRouter)
|