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 utils = require('../../utils/utils.js')
|
||||||
const logger = require('../../utils/logger.js')
|
const logger = require('../../utils/logger.js')
|
||||||
|
const auth = require('../../middlewares/auth.middleware.js')
|
||||||
|
|
||||||
|
let userDB
|
||||||
|
|
||||||
function GetApp () {
|
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({
|
app.use(bodyParser.urlencoded({
|
||||||
limit: '5mb',
|
limit: '5mb',
|
||||||
extended: true
|
extended: true
|
||||||
|
@ -47,6 +37,26 @@ function GetApp () {
|
||||||
app.use(bodyParser.json({
|
app.use(bodyParser.json({
|
||||||
limit: '5mb'
|
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.name = 'Data editor'
|
||||||
exports.getApp = GetApp
|
exports.getApp = GetApp
|
||||||
|
exports.setup = (data) => {
|
||||||
|
userDB = data.userDB
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<body bgcolor="#212127">
|
<body bgcolor="#222426">
|
||||||
<head>
|
<head>
|
||||||
<title>Frylabs</title>
|
<title>Frylabs</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -40,11 +40,14 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
input[type=text], input[type=password] {
|
input[type=text], input[type=password] {
|
||||||
|
font-size: 20px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #181a1b;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 12px 20px;
|
padding: 12px 20px;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 2px solid #fff;
|
border: 2px solid #333333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
input[type=text], input[type=password]:focus {
|
input[type=text], input[type=password]:focus {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<html>
|
<html>
|
||||||
<body bgcolor="#212127">
|
<body bgcolor="#222426">
|
||||||
<head>
|
<head>
|
||||||
<title>Frylabs</title>
|
<title>Frylabs</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -40,11 +40,14 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
input[type=text], input[type=password] {
|
input[type=text], input[type=password] {
|
||||||
|
font-size: 20px;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #181a1b;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 12px 20px;
|
padding: 12px 20px;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 2px solid #fff;
|
border: 2px solid #333333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
input[type=text], input[type=password]:focus {
|
input[type=text], input[type=password]:focus {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue