diff options
| author | Pitu <[email protected]> | 2021-06-20 18:53:59 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-06-20 18:53:59 +0900 |
| commit | 270b7acd4cf3e9c5ec0e7780ffdec0eba81fc0ad (patch) | |
| tree | 642eb521001d45aa53a8b99124532f07311295fd | |
| parent | chore: add defaults for stats and other features (diff) | |
| download | host.fuwn.me-270b7acd4cf3e9c5ec0e7780ffdec0eba81fc0ad.tar.xz host.fuwn.me-270b7acd4cf3e9c5ec0e7780ffdec0eba81fc0ad.zip | |
chore: hardcode api location
| -rw-r--r-- | src/api/structures/Server.js | 4 | ||||
| -rw-r--r-- | src/api/utils/Util.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js index f584fe8..b63d06d 100644 --- a/src/api/structures/Server.js +++ b/src/api/structures/Server.js @@ -76,8 +76,8 @@ class Server { for (const File of routes) { try { const route = new File(); - this.server[route.method](Util.config.routePrefix + route.path, route.authorize.bind(route)); - log.info(`Found route ${route.method.toUpperCase()} ${Util.config.routePrefix}${route.path}`); + this.server[route.method](`/api${route.path}`, route.authorize.bind(route)); + log.info(`Found route ${route.method.toUpperCase()} /api${route.path}`); } catch (e) { log.error(`Failed loading route from file ${routeFile} with error: ${e.message}`); } diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index 4dd0126..4e91954 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -40,7 +40,7 @@ class Util { static getEnvironmentDefaults() { return { domain: process.env.DOMAIN, - routePrefix: process.env.ROUTE_PREFIX || '/api', + routePrefix: '/api', rateLimitWindow: process.env.RATE_LIMIT_WINDOW || 2, rateLimitMax: process.env.RATE_LIMIT_MAX || 5, secret: process.env.SECRET || randomstring.generate(64), |