From d65bb0445ae9da6038f307114a1e72fd0b1d37fe Mon Sep 17 00:00:00 2001 From: Kevin Belisle Date: Fri, 2 Jul 2021 01:08:01 -0400 Subject: [PATCH] Prefix API routes with api/ --- app/src/main/kotlin/xyz/etztech/stonks/Api.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/xyz/etztech/stonks/Api.kt b/app/src/main/kotlin/xyz/etztech/stonks/Api.kt index b5abee2..a98b42f 100644 --- a/app/src/main/kotlin/xyz/etztech/stonks/Api.kt +++ b/app/src/main/kotlin/xyz/etztech/stonks/Api.kt @@ -24,7 +24,7 @@ fun initApiServer(apiServerPort: Int, database: Database) { val app = Javalin.create().start(apiServerPort) println("Javalin web server started") - app.get("/statistics") { ctx -> + app.get("api/statistics") { ctx -> run { if (statisticsCache.isEmpty() or (Duration.between(Instant.now(), statisticsCacheTimestamp) > @@ -48,7 +48,7 @@ fun initApiServer(apiServerPort: Int, database: Database) { } } - app.get("/statistics/:type/:name") { ctx -> + app.get("api/statistics/:type/:name") { ctx -> run { transaction(database) { addLogger(StdOutSqlLogger) @@ -78,7 +78,7 @@ fun initApiServer(apiServerPort: Int, database: Database) { } } - app.get("/players") { ctx -> + app.get("api/players") { ctx -> run { if (playersCache.isEmpty() or (Duration.between(Instant.now(), playersCacheTimestamp) > @@ -100,7 +100,7 @@ fun initApiServer(apiServerPort: Int, database: Database) { } } - app.get("/players/:playerId") { ctx -> + app.get("api/players/:playerId") { ctx -> run { transaction(database) { addLogger(StdOutSqlLogger) @@ -127,7 +127,7 @@ fun initApiServer(apiServerPort: Int, database: Database) { } } - app.get("/players/:playerId/:type/:name") { ctx -> + app.get("api/players/:playerId/:type/:name") { ctx -> run { transaction(database) { addLogger(StdOutSqlLogger)