handle manga page numbers

This commit is contained in:
Aria Moradi
2021-01-19 15:07:20 +03:30
parent fade116a02
commit 32a9321b8a
5 changed files with 17 additions and 14 deletions

View File

@@ -62,13 +62,15 @@ class Main {
ctx.json(getSourceList())
}
app.get("/api/v1/source/:source_id/popular") { ctx ->
app.get("/api/v1/source/:source_id/popular/:pageNum") { ctx ->
val sourceId = ctx.pathParam("source_id")
ctx.json(getPopularManga(sourceId))
val pageNum = ctx.pathParam("pageNum").toInt()
ctx.json(getPopularManga(sourceId,pageNum))
}
app.get("/api/v1/source/:source_id/latest") { ctx ->
app.get("/api/v1/source/:source_id/latest/:pageNum") { ctx ->
val sourceId = ctx.pathParam("source_id")
ctx.json(getLatestManga(sourceId))
val pageNum = ctx.pathParam("pageNum").toInt()
ctx.json(getLatestManga(sourceId,pageNum))
}
}