fix paths

This commit is contained in:
41666 2023-05-30 18:37:56 -04:00
parent 7ef2fe757c
commit 1b1b9da9b4
3 changed files with 32 additions and 4 deletions

View file

@ -0,0 +1,27 @@
job "agg-population" {
type = "service"
update {
max_parallel = 1
stagger = "10s"
}
group "api" {
count = 1
network {
port "http" {
static = 3000
}
}
task "api" {
driver = "docker"
config {
image = "ghcr.io/genudine/agg-population/agg-population:7ef2fe757cec4da36fa9462a09403bbf022f77fa"
ports = ["http"]
}
}
}
}

View file

@ -47,8 +47,8 @@
>
</div>
<div class="api-list">
<a class="api-item" href="/worlds/1">GET /worlds/{worldID} ▶️</a>
<a class="api-item" href="/worlds/all">GET /worlds/all ▶️</a>
<a class="api-item" href="/population/1">GET /population/{worldID} ▶️</a>
<a class="api-item" href="/population/all">GET /population/all ▶️</a>
</div>
<p>Results are cached for 3 minutes. Requesting faster is a dumb idea.</p>
</main>

View file

@ -17,8 +17,9 @@ async fn main() {
let app = Router::new()
.route("/", get(root))
.route("/worlds/all", get(get_all_worlds))
.route("/worlds/:world", get(get_one_world))
.route("/population", get(root))
.route("/population/all", get(get_all_worlds))
.route("/population/:world", get(get_one_world))
.layer(TraceLayer::new_for_http())
.with_state(db);