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
|
WORKDIR /usr/src/school_app_api
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
RUN cargo install sqlx-cli
|
||||||
RUN cargo install --path .
|
RUN cargo install --path .
|
||||||
|
|
||||||
FROM debian:buster-slim
|
CMD ["start.sh"]
|
||||||
COPY --from=build /usr/local/cargo/bin/school_app_api /usr/local/bin/school_app_api
|
|
||||||
CMD ["school_app_api"]
|
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,7 @@ async fn main() {
|
|||||||
.route("/user/signin", post(signin))
|
.route("/user/signin", post(signin))
|
||||||
.route("/event", post(events::create_event))
|
.route("/event", post(events::create_event))
|
||||||
.route("/event/preview", get(events::get_events_preview))
|
.route("/event/preview", get(events::get_events_preview))
|
||||||
|
.route("/report", get(report::get_report))
|
||||||
.with_state(AppState {
|
.with_state(AppState {
|
||||||
db_pool,
|
db_pool,
|
||||||
jwt_encode,
|
jwt_encode,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use axum_auth::AuthBearer;
|
use axum_auth::AuthBearer;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use sqlx::{query, query_as};
|
use sqlx::query_as;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
jwt::handle_token,
|
jwt::handle_token,
|
||||||
@ -14,7 +14,7 @@ use crate::{
|
|||||||
AppState,
|
AppState,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub async fn report(
|
pub async fn get_report(
|
||||||
AuthBearer(token): AuthBearer,
|
AuthBearer(token): AuthBearer,
|
||||||
State(app_state): State<AppState>,
|
State(app_state): State<AppState>,
|
||||||
Query(report_query): Query<ReportQuery>,
|
Query(report_query): Query<ReportQuery>,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user