Add stats route

This commit is contained in:
2021-08-12 10:19:28 +02:00
parent 2459331c62
commit d62674db00
3 changed files with 14 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
export default class StatsController {
public async index ({ response }: HttpContextContract) {
return response.status(200).send({
message: 'Stats is under maintenance! Come back later.'
})
}
}

View File

@@ -3,9 +3,9 @@ import Application from "@ioc:Adonis/Core/Application";
Route.get('/discord', 'ProfileController.discord') Route.get('/discord', 'ProfileController.discord')
Route.get('/me', 'ProfileController.me') Route.get('/me', 'ProfileController.me')
Route.get('/stats', 'StatsController.index')
Route.group(() => { Route.group(() => {
Route.resource('/users', 'UsersController').except(['edit', 'create']) Route.resource('/users', 'UsersController').except(['edit', 'create'])
Route.resource('/translations', 'TranslationsController').except(['edit', 'create']) Route.resource('/translations', 'TranslationsController').except(['edit', 'create'])

View File

@@ -13,9 +13,8 @@ Route.get('/', async ({response}: HttpContextContract) => {
healthCheck: `${BASE_URL}/health`, healthCheck: `${BASE_URL}/health`,
routes: { routes: {
profile: `${BASE_URL}/me`, profile: `${BASE_URL}/me`,
//stats: `${BASE_URL}/stats`, stats: `${BASE_URL}/stats`,
locations: `${BASE_URL}/locations`, locations: `${BASE_URL}/locations`
projects: `${BASE_URL}/projects`
} }
}) })
}) })
@@ -34,5 +33,3 @@ Route.get('/health', async ({response}: HttpContextContract) => {
report: report.report report: report.report
}) })
}) })
Route.get('/stats', 'StatsController.get')