Fixed issue with order of loading shit...

This commit is contained in:
BurnyLlama 2021-11-06 15:42:11 +01:00
parent 32cb0ab344
commit 74bc24da55
2 changed files with 16 additions and 1 deletions

View File

@ -21,13 +21,13 @@ const log = initLog("[ MAIN ]")
// Read the .env file
dotenv.config()
dbInit()
setStat("startup", start)
setStat("lastDBUpdate", start)
if (process.env.DOWNLOAD_FILES === "enabled")
await downloadEssentialData()
dbInit()
generateDB()
const Server = express()

View File

@ -12,6 +12,21 @@ routes.get(
}
)
routes.get(
'/search',
(req, res) => {
const map = req.query.qmap ?? ""
const categories = req.query.categories ?? []
const stars = req.query.stars ?? []
const sort = req.query.sortBy ?? "map"
const order = req.query.order === "desc" ? "desc" : "asc"
const maps = wrapper.searchMap(map, categories.split(","), stars.split(","), sort, order)
tx(req, res)('pages/maps.njk', { maps }, true, { currentSection: "maps" })
}
)
routes.get(
'/maps',
(req, res) => {