-
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: re-structure api folders (#48)
- Loading branch information
1 parent
6bb9f87
commit 2d7c143
Showing
9 changed files
with
16 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# If there is a .env file located at `crates/server/.env`, it will be loaded automatically | ||
set dotenv-load | ||
|
||
# https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md | ||
# The DATABASE_URL env var must be set to run those commands | ||
# If there is a .env file located at `crates/server/.env`, it will be loaded automatically | ||
prepare-check: | ||
cargo sqlx prepare --check --workspace | ||
prepare: # To be able to build the project in offline mode | ||
cargo sqlx prepare --workspace | ||
migrate: | ||
cargo sqlx migrate run | ||
run: | ||
cargo run -p gq-server |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod dtos; | ||
pub mod routes; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 7 additions & 8 deletions
15
crates/server/src/routes/shares.rs → crates/server/src/api/routes/shares.rs
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
File renamed without changes.
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,14 +1,13 @@ | ||
use app_state::AppState; | ||
use axum::Router; | ||
use sqlx::PgPool; | ||
use state::AppState; | ||
|
||
pub mod dtos; | ||
pub mod api; | ||
pub mod app_state; | ||
pub mod model; | ||
pub mod routes; | ||
pub mod services; | ||
pub mod state; | ||
|
||
pub fn app(db_connection: PgPool, max_share_expiration_time_secs: i64) -> Router { | ||
let app_state = AppState::new(db_connection, max_share_expiration_time_secs); | ||
routes::router(app_state) | ||
api::routes::router(app_state) | ||
} |