From f74069deb6b3078301c425959b989ae1f49a53d0 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 25 Aug 2022 23:35:17 +0100 Subject: [PATCH] fix: API not working on Windows --- src/http.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http.js b/src/http.js index f695fad..4c71c2f 100644 --- a/src/http.js +++ b/src/http.js @@ -135,6 +135,7 @@ module.exports = client => { const path = file .substring(0, file.length - 3) // remove `.js` .substring(dir.length) // remove higher directories + .replace(/\\/g, '/') // replace `\` with `/` because Windows is stupid .replace(/\[(\w+)\]/gi, ':$1') // convert [] to : .replace('/index', '') || '/'; // remove index const route = require(file);