mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-01 08:21:27 +03:00
fix: API not working on Windows
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user