mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-25 00:07:59 +00:00
working backend on docker (#226)
* working backend on docker refactor of the dockerfiles to be more readable and independent. full build of the backend (release only) within docker * read `PORT` to u16 * Only need one `PORT` in the new backend Co-authored-by: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com>
This commit is contained in:
+4
-2
@@ -86,7 +86,9 @@ fn main() -> std::io::Result<()> {
|
||||
let aggregator = Aggregator::new().start();
|
||||
let factory = LocatorFactory::new();
|
||||
let locator = SyncArbiter::start(4, move || factory.create());
|
||||
|
||||
|
||||
let port = std::env::var("PORT").ok().and_then(|v| v.parse().ok()).unwrap_or(8000u16);
|
||||
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.data(aggregator.clone())
|
||||
@@ -98,7 +100,7 @@ fn main() -> std::io::Result<()> {
|
||||
.service(resource("/network_state/{chain}/{nid}").route(get().to_async(state_route)))
|
||||
.service(resource("/network_state/{chain}/{nid}/").route(get().to_async(state_route)))
|
||||
})
|
||||
.bind("0.0.0.0:8000")?
|
||||
.bind(format!("0.0.0.0:{}", port))?
|
||||
.start();
|
||||
|
||||
sys.run()
|
||||
|
||||
Reference in New Issue
Block a user