Skip to content

Commit

Permalink
Update Axum route definitions to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Jan 2, 2025
1 parent d00e81a commit 421ab14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rusqlite = { version = "0.32.1", features = ["bundled", "serde_json"] }
tower = { version = "0.5", features = ["util"] }
tower-http = { version = "0.6.2", features = ["fs", "normalize-path"] }
axum = { version = "0.8", features = ["macros"] }
axum-macros = "0.5.0"
axum-macros = "0.5"
http-body-util = "0.1.2"
percent-encoding = "2.3.1"
mime_guess = "2.0"
Expand Down
52 changes: 26 additions & 26 deletions src/bin/pombase-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,36 +737,36 @@ async fn main() {

println!("Starting server ...");
let app = Router::new()
.route("/*path", get(get_misc))
.route("/{*path}", get(get_misc))
.route("/", get(get_index))
.route("/structure_view/:structure_type/:id", get(structure_view))
.route("/rna_2d_structure/:gene_uniquename/:urs_id", get(rna_2d_structure))
.route("/protein_feature_view/:scope/:gene_uniquename", get(protein_feature_view))
.route("/gocam_viz/:full_or_widget/:gocam_id", get(gocam_viz))
.route("/simple/gene/:id", get(get_simple_gene))
.route("/simple/genotype/:id", get(get_simple_genotype))
.route("/simple/reference/:id", get(get_simple_reference))
.route("/simple/term/:id", get(get_simple_term))
.route("/api/v1/dataset/latest/complete/allele/*q", get(allele_complete))
.route("/api/v1/dataset/latest/complete/ref/:q", get(ref_complete))
.route("/api/v1/dataset/latest/complete/term/:cv_name/:q", get(term_complete))
.route("/api/v1/dataset/latest/data/allele/:id", get(get_allele))
.route("/api/v1/dataset/latest/data/gene/:id", get(get_gene))
.route("/api/v1/dataset/latest/data/genotype/:id", get(get_genotype))
.route("/api/v1/dataset/latest/data/reference/:id", get(get_reference))
.route("/structure_view/{structure_type}/{id}", get(structure_view))
.route("/rna_2d_structure/{gene_uniquename}/{urs_id}", get(rna_2d_structure))
.route("/protein_feature_view/{scope}/{gene_uniquename}", get(protein_feature_view))
.route("/gocam_viz/{full_or_widget}/{gocam_id}", get(gocam_viz))
.route("/simple/gene/{id}", get(get_simple_gene))
.route("/simple/genotype/{id}", get(get_simple_genotype))
.route("/simple/reference/{id}", get(get_simple_reference))
.route("/simple/term/{id}", get(get_simple_term))
.route("/api/v1/dataset/latest/complete/allele/{*q}", get(allele_complete))
.route("/api/v1/dataset/latest/complete/ref/{q}", get(ref_complete))
.route("/api/v1/dataset/latest/complete/term/{cv_name}/{q}", get(term_complete))
.route("/api/v1/dataset/latest/data/allele/{id}", get(get_allele))
.route("/api/v1/dataset/latest/data/gene/{id}", get(get_gene))
.route("/api/v1/dataset/latest/data/genotype/{id}", get(get_genotype))
.route("/api/v1/dataset/latest/data/reference/{id}", get(get_reference))
.route("/api/v1/dataset/latest/data/seq_feature_page_features", get(seq_feature_page_features))
.route("/api/v1/dataset/latest/data/term/:id", get(get_term))
.route("/api/v1/dataset/latest/data/gocam/:full_or_widget/:gene_uniquename", get(get_gocam_data))
.route("/api/v1/dataset/latest/data/term/{id}", get(get_term))
.route("/api/v1/dataset/latest/data/gocam/{full_or_widget}/{gene_uniquename}", get(get_gocam_data))
.route("/api/v1/dataset/latest/data/gocam/all", get(get_all_gocam_data))
.route("/api/v1/dataset/latest/data/gocam/by_id/:gocam_id", get(get_all_gocam_data_by_id))
.route("/api/v1/dataset/latest/gene_ex_violin_plot/:plot_size/:genes", get(gene_ex_violin_plot))
.route("/api/v1/dataset/latest/stats/:type", get(get_stats))
.route("/api/v1/dataset/latest/motif_search/:scope/:q/:max_gene_details", get(motif_search))
.route("/api/v1/dataset/latest/protein_features/:scope/:gene_uniquename", get(get_protein_features))
.route("/api/v1/dataset/latest/query/:q", get(query_get))
.route("/api/v1/dataset/latest/data/gocam/by_id/{gocam_id}", get(get_all_gocam_data_by_id))
.route("/api/v1/dataset/latest/gene_ex_violin_plot/{plot_size}/{genes}", get(gene_ex_violin_plot))
.route("/api/v1/dataset/latest/stats/{type}", get(get_stats))
.route("/api/v1/dataset/latest/motif_search/{scope}/{q}/{max_gene_details}", get(motif_search))
.route("/api/v1/dataset/latest/protein_features/{scope}/{gene_uniquename}", get(get_protein_features))
.route("/api/v1/dataset/latest/query/{q}", get(query_get))
.route("/api/v1/dataset/latest/query", post(query_post))
.route("/api/v1/dataset/latest/search/:scope/:q", get(solr_search))
.route("/api/v1/dataset/latest/summary/term/:id", get(get_term_summary_by_id))
.route("/api/v1/dataset/latest/search/{scope}/{q}", get(solr_search))
.route("/api/v1/dataset/latest/summary/term/{id}", get(get_term_summary_by_id))
.route("/ping", get(ping))
.fallback(not_found)
.with_state(Arc::new(all_state));
Expand Down

0 comments on commit 421ab14

Please sign in to comment.