Remove testing code
This commit is contained in:
parent
becbce9273
commit
742a25cde8
4
index.js
4
index.js
|
@ -14,8 +14,6 @@ import { generateDB } from './libs/database/generate.js'
|
|||
import { dbInit } from './libs/database/init.js'
|
||||
import { getStats, setStat } from './libs/serverStats.js'
|
||||
import { downloadEssentialData } from './libs/download/dowload.js'
|
||||
import { ddnssStart } from './libs/ddnss/handler.js'
|
||||
import { searchMap } from './libs/database/wrapper.js'
|
||||
|
||||
const start = Date.now()
|
||||
const log = initLog("[ MAIN ]")
|
||||
|
@ -52,5 +50,3 @@ const elapsed = Date.now() - start
|
|||
log(`Took ${elapsed/1000} seconds to start the server!`)
|
||||
|
||||
Server.listen(process.env.PORT ?? 12345, () => log(`Server started and listening on port ${process.env.PORT}.`))
|
||||
|
||||
console.log(searchMap("", ["Solo"], [0,1,2,3,4,5], "points", "DESC", 1))
|
|
@ -322,6 +322,7 @@ export function graphMap(map, player) {
|
|||
* @param {array} stars Only include maps with a specific amount of stars [1, 5]
|
||||
* @param {string} sortBy What to sort after
|
||||
* @param {string} order "ASC" | "DESC"
|
||||
* @param {number} page Which page?
|
||||
*
|
||||
* @returns {array} Returns an array of all maps found
|
||||
*/
|
||||
|
@ -351,10 +352,6 @@ export function searchMap(query, categories, stars, sortBy, order, page) {
|
|||
output.push(prettyifyMap(map))
|
||||
}
|
||||
|
||||
console.log(entriesPerPage * (page - 1))
|
||||
console.log(entriesPerPage * (page))
|
||||
console.log(maps.length)
|
||||
|
||||
return { "pageInfo": pageInfo, "maps": output }
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ routes.get(
|
|||
(req, res) => {
|
||||
const map = req.query.map ?? ""
|
||||
const categories = req.query.categories ? req.query.categories : "Novice,Moderate,Brutal,Insane,Dummy,DDmaX,Oldschool,Solo,Race,Fun"
|
||||
const stars = req.query.stars ? req.query.stars : "1,2,3,4,5"
|
||||
const stars = req.query.stars ? req.query.stars : "0,1,2,3,4,5"
|
||||
const sort = req.query.sortBy ? req.query.sortBy : "map"
|
||||
const order = req.query.order === "desc" ? "desc" : "asc"
|
||||
const page = req.query.page ? req.query.page : "1"
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<h3> Found: {{ data.maps.pageInfo.mapCount }} Page: {{ data.maps.pageInfo.page }}/{{ data.maps.pageInfo.totalPages }}
|
||||
|
||||
<main class="flex-container">
|
||||
<form action="/search" method="get" id="search">
|
||||
<h1>Search</h1>
|
||||
|
|
Loading…
Reference in New Issue
Block a user