添加静态文件夹
This commit is contained in:
parent
d9c7a93aca
commit
c81f6df88d
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -9,9 +9,10 @@ mongoose.connect(MONGDB_URL, (error) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const app = express()
|
const app = express()
|
||||||
|
app.use(express.static('public'))
|
||||||
app.set('view engine', 'pug')
|
app.set('view engine', 'pug')
|
||||||
app.get('/', async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
res.render('index', { title: 'hello, world!' })
|
res.render('index', { title: '文件分享服务器' })
|
||||||
})
|
})
|
||||||
const server = app.listen(SERVER_PORT, SERVER_HOST, () => {
|
const server = app.listen(SERVER_PORT, SERVER_HOST, () => {
|
||||||
console.info(`server is running at http://${SERVER_HOST}:${SERVER_PORT}`)
|
console.info(`server is running at http://${SERVER_HOST}:${SERVER_PORT}`)
|
||||||
|
Loading…
Reference in New Issue
Block a user