fix paths
This commit is contained in:
parent
7ef2fe757c
commit
1b1b9da9b4
3 changed files with 32 additions and 4 deletions
27
nomad/agg-population.nomad.hcl
Normal file
27
nomad/agg-population.nomad.hcl
Normal 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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -47,8 +47,8 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="api-list">
|
<div class="api-list">
|
||||||
<a class="api-item" href="/worlds/1">GET /worlds/{worldID} ▶️</a>
|
<a class="api-item" href="/population/1">GET /population/{worldID} ▶️</a>
|
||||||
<a class="api-item" href="/worlds/all">GET /worlds/all ▶️</a>
|
<a class="api-item" href="/population/all">GET /population/all ▶️</a>
|
||||||
</div>
|
</div>
|
||||||
<p>Results are cached for 3 minutes. Requesting faster is a dumb idea.</p>
|
<p>Results are cached for 3 minutes. Requesting faster is a dumb idea.</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -17,8 +17,9 @@ async fn main() {
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(root))
|
.route("/", get(root))
|
||||||
.route("/worlds/all", get(get_all_worlds))
|
.route("/population", get(root))
|
||||||
.route("/worlds/:world", get(get_one_world))
|
.route("/population/all", get(get_all_worlds))
|
||||||
|
.route("/population/:world", get(get_one_world))
|
||||||
.layer(TraceLayer::new_for_http())
|
.layer(TraceLayer::new_for_http())
|
||||||
.with_state(db);
|
.with_state(db);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue