forked from Minecraft/Stonks
Prefix API routes with api/
parent
5945276b1d
commit
d65bb0445a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue