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)