Skip to content

Commit

Permalink
fix: API not working on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Aug 25, 2022
1 parent 9936b05 commit f74069d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f74069d

Please sign in to comment.