running now migrates then runs
This commit is contained in:
parent
7842a6014c
commit
8835413257
@ -4,9 +4,8 @@ ENV DATABASE_URL="postgres://school_app_api_user:school_app_api_pass@mdev.local/
|
||||
WORKDIR /usr/src/school_app_api
|
||||
COPY . .
|
||||
|
||||
RUN cargo install sqlx-cli
|
||||
RUN cargo install --path .
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=build /usr/local/cargo/bin/school_app_api /usr/local/bin/school_app_api
|
||||
CMD ["school_app_api"]
|
||||
CMD ["start.sh"]
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ async fn main() {
|
||||
.route("/user/signin", post(signin))
|
||||
.route("/event", post(events::create_event))
|
||||
.route("/event/preview", get(events::get_events_preview))
|
||||
.route("/report", get(report::get_report))
|
||||
.with_state(AppState {
|
||||
db_pool,
|
||||
jwt_encode,
|
||||
|
||||
@ -6,7 +6,7 @@ use axum::{
|
||||
};
|
||||
use axum_auth::AuthBearer;
|
||||
use serde_json::json;
|
||||
use sqlx::{query, query_as};
|
||||
use sqlx::query_as;
|
||||
|
||||
use crate::{
|
||||
jwt::handle_token,
|
||||
@ -14,7 +14,7 @@ use crate::{
|
||||
AppState,
|
||||
};
|
||||
|
||||
pub async fn report(
|
||||
pub async fn get_report(
|
||||
AuthBearer(token): AuthBearer,
|
||||
State(app_state): State<AppState>,
|
||||
Query(report_query): Query<ReportQuery>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user