mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: add basic auth to analytics
This commit is contained in:
1 parent
8430ce4428
commit
1ab394f187
4 files changed
+37
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import connectDB from '@linux-odyssey/models'
|
||||
import express from 'express'
|
||||
import { engine } from 'express-handlebars'
|
||||
import basicAuth from 'express-basic-auth'
|
||||
import config from './config.js'
|
||||
import router from './router.js'
|
||||
|
||||
@@ -13,6 +14,13 @@ async function main() {
|
||||
app.set('view engine', 'handlebars')
|
||||
app.set('views', './views')
|
||||
|
||||
app.use(
|
||||
basicAuth({
|
||||
users: { [config.username]: config.password },
|
||||
challenge: true,
|
||||
realm: 'Linux Odyssey Admin Dashboard',
|
||||
})
|
||||
)
|
||||
app.use(router)
|
||||
app.use(express.static('./public'))
|
||||
|
||||
|
||||
Reference in new issue
Block a user