forked from torrust/torrust-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): [torrust#208] use API impementation enum for API versi…
…oning We've removed the ActixWeb implementation for the API. We can use the enum for implementations for versioning the API. Currently there is only one version `v1` but i'ts ready to add the verion `v2`.
- Loading branch information
1 parent
44c799e
commit 717cdaa
Showing
44 changed files
with
1,380 additions
and
1,396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
use torrust_index_backend::app; | ||
use torrust_index_backend::bootstrap::config::init_configuration; | ||
use torrust_index_backend::web::api::Implementation; | ||
use torrust_index_backend::web::api::Version; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), std::io::Error> { | ||
let configuration = init_configuration().await; | ||
|
||
let api_implementation = Implementation::Axum; | ||
let api_version = Version::V1; | ||
|
||
let app = app::run(configuration, &api_implementation).await; | ||
let app = app::run(configuration, &api_version).await; | ||
|
||
match api_implementation { | ||
Implementation::Axum => app.axum_api_server.unwrap().await.expect("the Axum API server was dropped"), | ||
match api_version { | ||
Version::V1 => app.api_server.unwrap().await.expect("the API server was dropped"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.