Skip to content

Commit

Permalink
Should be fixed now
Browse files Browse the repository at this point in the history
  • Loading branch information
renatodellosso committed Jul 26, 2024
1 parent 753a407 commit 3ed72ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ export namespace API {
}

const routeRaw = req.url.replace(this.basePath, "");
const route = routeRaw.substring(0, routeRaw.indexOf("?"));
console.log(routeRaw, "->", route);
const route = routeRaw.includes("?")
? routeRaw.substring(0, routeRaw.indexOf("?"))
: routeRaw;

if (route in this.routes) {
this.routes[route](req, res, {
Expand Down

0 comments on commit 3ed72ed

Please sign in to comment.