Skip to content

Commit

Permalink
apply changes to endpoint in server
Browse files Browse the repository at this point in the history
  • Loading branch information
bragov4ik committed Aug 23, 2024
1 parent 0d01bdf commit 76eec0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions stats/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion stats/stats-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sea-orm = { version = "0.12", features = [
] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
blockscout-service-launcher = { workspace = true, features = [ "database-0_12" ] }
blockscout-endpoint-swagger = { git = "https://github.com/blockscout/blockscout-rs", rev = "aea7256" }
blockscout-endpoint-swagger = { git = "https://github.com/blockscout/blockscout-rs", rev = "0d01bdf7" }
cron = "0.12"
convert_case = "0.6.0"
itertools = "0.11.0"
Expand Down
9 changes: 4 additions & 5 deletions stats/stats-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{
update_service::UpdateService,
};

use blockscout_endpoint_swagger::route_swagger;
use blockscout_service_launcher::launcher::{self, LaunchSettings};
use sea_orm::{ConnectOptions, Database};
use stats_proto::blockscout::stats::v1::{
Expand All @@ -28,13 +29,11 @@ struct HttpRouter<S: StatsService> {

impl<S: StatsService> launcher::HttpRouter for HttpRouter<S> {
fn register_routes(&self, service_config: &mut actix_web::web::ServiceConfig) {
let swagger_file = std::path::PathBuf::from("../stats-proto/swagger/stats.swagger.yaml");
service_config
.configure(|config| route_health(config, self.health.clone()))
.configure(|config| route_stats_service(config, self.stats.clone()));
blockscout_endpoint_swagger::register_route(
service_config,
std::path::PathBuf::from("../stats-proto/swagger/stats.swagger.yaml"),
);
.configure(|config| route_stats_service(config, self.stats.clone()))
.configure(|config| route_swagger(config, swagger_file, "/api/v1/docs/swagger.yaml"));
}
}

Expand Down

0 comments on commit 76eec0b

Please sign in to comment.