mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added auth middleware to dataeditor, bg color change on some places
This commit is contained in:
parent
b970b2eb30
commit
143894288a
3 changed files with 36 additions and 17 deletions
|
@ -25,21 +25,11 @@ const app = express()
|
|||
|
||||
const utils = require('../../utils/utils.js')
|
||||
const logger = require('../../utils/logger.js')
|
||||
const auth = require('../../middlewares/auth.middleware.js')
|
||||
|
||||
let userDB
|
||||
|
||||
function GetApp () {
|
||||
app.set('view engine', 'ejs')
|
||||
app.set('views', [
|
||||
'./modules/dataEditor/views',
|
||||
'./sharedViews'
|
||||
])
|
||||
app.use(express.static('modules/dataEditor/public'))
|
||||
app.use(express.static('public'))
|
||||
app.use(busboy({
|
||||
limits: {
|
||||
fileSize: 10000 * 1024 * 1024
|
||||
}
|
||||
}))
|
||||
app.use(bodyParser.json())
|
||||
app.use(bodyParser.urlencoded({
|
||||
limit: '5mb',
|
||||
extended: true
|
||||
|
@ -47,6 +37,26 @@ function GetApp () {
|
|||
app.use(bodyParser.json({
|
||||
limit: '5mb'
|
||||
}))
|
||||
app.set('view engine', 'ejs')
|
||||
app.set('views', [
|
||||
'./modules/dataEditor/views',
|
||||
'./sharedViews'
|
||||
])
|
||||
app.use(auth({
|
||||
userDB: userDB,
|
||||
jsonResponse: false,
|
||||
exceptions: [
|
||||
'/favicon.ico',
|
||||
'/getVeteranPw'
|
||||
]
|
||||
}))
|
||||
app.use(express.static('modules/dataEditor/public'))
|
||||
app.use(express.static('public'))
|
||||
app.use(busboy({
|
||||
limits: {
|
||||
fileSize: 10000 * 1024 * 1024
|
||||
}
|
||||
}))
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
@ -91,3 +101,6 @@ function GetApp () {
|
|||
|
||||
exports.name = 'Data editor'
|
||||
exports.getApp = GetApp
|
||||
exports.setup = (data) => {
|
||||
userDB = data.userDB
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue