added / fixed some types

This commit is contained in:
mrfry
2022-03-14 19:35:42 +01:00
parent 5f12284bb8
commit bc5c293539
41 changed files with 4378 additions and 8304 deletions
+9 -22
View File
@@ -19,9 +19,7 @@
------------------------------------------------------------------------- */
// package requires
import express from 'express'
import bodyParser from 'body-parser'
import busboy from 'connect-busboy'
import express, { RequestHandler } from 'express'
const app = express()
// other requires
@@ -30,7 +28,7 @@ import { SetupData } from '../../server'
import { ModuleType } from '../../types/basicTypes'
// stuff gotten from server.js
let publicdirs = []
let publicdirs: string[] = []
let url = '' // http(s)//asd.basd
function GetApp(): ModuleType {
@@ -40,39 +38,28 @@ function GetApp(): ModuleType {
logger.Log(`Using public dir: ${pdir}`)
app.use(express.static(pdir))
})
app.use(express.json() as RequestHandler)
app.use(
busboy({
limits: {
fileSize: 10000 * 1024 * 1024,
},
})
)
app.use(bodyParser.json())
app.use(
bodyParser.urlencoded({
express.urlencoded({
limit: '5mb',
extended: true,
})
)
app.use(
bodyParser.json({
limit: '5mb',
})
}) as RequestHandler
)
// --------------------------------------------------------------
app.get('/', function(req, res) {
app.get('/', function (_req, res) {
res.render('main', {
siteurl: url,
})
})
app.get('*', function(req, res) {
app.get('*', function (_req, res) {
res.status(404).render('404')
})
app.post('*', function(req, res) {
app.post('*', function (_req, res) {
res.status(404).render('404')
})