Lint and update

This commit is contained in:
2021-11-10 12:06:58 +01:00
parent dabdb26e9a
commit e1b4d2e1a5
118 changed files with 2477 additions and 778 deletions

View File

@@ -1,11 +1,11 @@
import Env from "@ioc:Adonis/Core/Env";
import Route from "@ioc:Adonis/Core/Route";
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
import HealthCheck from "@ioc:Adonis/Core/HealthCheck";
import Env from '@ioc:Adonis/Core/Env'
import Route from '@ioc:Adonis/Core/Route'
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import HealthCheck from '@ioc:Adonis/Core/HealthCheck'
const BASE_URL = Env.get('BASE_URL')
Route.get('/', async ({response}: HttpContextContract) => {
Route.get('/', async({ response }: HttpContextContract) => {
return response.status(200).send({
domain: BASE_URL,
version: Env.get('API_VERSION'),
@@ -15,22 +15,24 @@ Route.get('/', async ({response}: HttpContextContract) => {
profile: `${BASE_URL}/me`,
stats: `${BASE_URL}/stats`,
states: `${BASE_URL}/states`,
locations: `${BASE_URL}/locations`
}
locations: `${BASE_URL}/locations`,
},
})
})
Route.get('/source', async ({response}: HttpContextContract) => {
Route.get('/source', async({ response }: HttpContextContract) => {
return response.redirect(Env.get('GITHUB_SOURCE'))
})
Route.get('/health', async ({response}: HttpContextContract) => {
Route.get('/health', async({ response }: HttpContextContract) => {
const report = await HealthCheck.getReport()
const isLive = await HealthCheck.isLive()
const isReady = HealthCheck.isReady()
return report.healthy ? response.ok({isLive, isReady, report: report.report}) : response.badRequest({
isLive,
isReady,
report: report.report
})
return report.healthy
? response.ok({ isLive, isReady, report: report.report })
: response.badRequest({
isLive,
isReady,
report: report.report,
})
})