Fixed issue with order of loading shit...
This commit is contained in:
parent
32cb0ab344
commit
74bc24da55
2
index.js
2
index.js
|
@ -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()
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user