diff options
author | 2021-08-23 09:34:46 +0530 | |
---|---|---|
committer | 2021-08-23 09:34:46 +0530 | |
commit | e5e50f4d7a8a24cb1061b563759108ffd0140825 (patch) | |
tree | 58df2e8fc2ee6ba3a0ef95cd7d8fc4032d95f4ce /src/internal-server/start | |
parent | 5.6.1-nightly.36 [skip ci] (diff) | |
download | ferdium-app-e5e50f4d7a8a24cb1061b563759108ffd0140825.tar.gz ferdium-app-e5e50f4d7a8a24cb1061b563759108ffd0140825.tar.zst ferdium-app-e5e50f4d7a8a24cb1061b563759108ffd0140825.zip |
refactor: Reuse constants and utility functions to remove hardcoding/duplication
Diffstat (limited to 'src/internal-server/start')
-rw-r--r-- | src/internal-server/start/routes.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js index 6668f3062..b32b094ee 100644 --- a/src/internal-server/start/routes.js +++ b/src/internal-server/start/routes.js | |||
@@ -8,6 +8,7 @@ | |||
8 | /** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */ | 8 | /** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */ |
9 | const Route = use('Route'); | 9 | const Route = use('Route'); |
10 | 10 | ||
11 | const { API_VERSION } = require('../../environment'); | ||
11 | // Run latest database migration | 12 | // Run latest database migration |
12 | const migrate = require('./migrate'); | 13 | const migrate = require('./migrate'); |
13 | 14 | ||
@@ -67,11 +68,11 @@ Route.group(() => { | |||
67 | Route.get('services', 'StaticController.emptyArray'); | 68 | Route.get('services', 'StaticController.emptyArray'); |
68 | Route.get('news', 'StaticController.emptyArray'); | 69 | Route.get('news', 'StaticController.emptyArray'); |
69 | Route.get('announcements/:version', 'StaticController.announcement'); | 70 | Route.get('announcements/:version', 'StaticController.announcement'); |
70 | }).prefix('v1').middleware(OnlyAllowFerdi); | 71 | }).prefix(API_VERSION).middleware(OnlyAllowFerdi); |
71 | 72 | ||
72 | Route.group(() => { | 73 | Route.group(() => { |
73 | Route.get('icon/:id', 'ServiceController.icon'); | 74 | Route.get('icon/:id', 'ServiceController.icon'); |
74 | }).prefix('v1'); | 75 | }).prefix(API_VERSION); |
75 | 76 | ||
76 | // Franz account import | 77 | // Franz account import |
77 | Route.post('import', 'UserController.import'); | 78 | Route.post('import', 'UserController.import'); |