Added basic auth
This commit is contained in:
@@ -3,6 +3,7 @@ const Database = require("better-sqlite3");
|
||||
const winston = require("winston");
|
||||
const path = require("path");
|
||||
const fileUpload = require("express-fileupload");
|
||||
const basicAuth = require("express-basic-auth");
|
||||
const fs = require("fs");
|
||||
const app_conf = require("./app/config/app.conf.js");
|
||||
const db_conf = require("./app/config/db.conf.js");
|
||||
@@ -19,10 +20,15 @@ app.use(app_conf.web_paths.js, express.static(path.join(__dirname, app_conf.web_
|
||||
app.use(express.json());
|
||||
app.use(fileUpload({
|
||||
limits: { fileSize: 102400 },
|
||||
|
||||
useTempFiles: true,
|
||||
tempFileDir: path.join(__dirname, app_conf.temp_directory)
|
||||
}));
|
||||
app.use(basicAuth({
|
||||
users: {
|
||||
[app_conf.username]: app_conf.password
|
||||
},
|
||||
challenge: true
|
||||
}));
|
||||
|
||||
/*
|
||||
* Initialize console and file logger
|
||||
|
||||
Reference in New Issue
Block a user