Avvailable from external source
pages and backend are now available from everywhere on the network
This commit is contained in:
@@ -68,6 +68,7 @@ pub async fn delete_ticket(
|
||||
pub async fn get_tickets(
|
||||
State(data): State<Arc<AppState>>,
|
||||
) -> Result<impl IntoResponse, (StatusCode, Json<serde_json::Value>)> {
|
||||
println!("get_tickets called");
|
||||
let tickets = sqlx::query_as::<_, Ticket>(
|
||||
r#"SELECT * FROM tickets WHERE status <> 'Archived' ORDER BY date DESC"#,
|
||||
)
|
||||
@@ -80,6 +81,7 @@ pub async fn get_tickets(
|
||||
});
|
||||
(StatusCode::INTERNAL_SERVER_ERROR, Json(error_response))
|
||||
})?;
|
||||
println!("Tickets fetched");
|
||||
|
||||
let ticket_response = tickets
|
||||
.iter()
|
||||
@@ -87,6 +89,7 @@ pub async fn get_tickets(
|
||||
.collect::<Vec<TicketResponse>>();
|
||||
|
||||
let json_response = serde_json::json!(ticket_response);
|
||||
println!("Json contructed");
|
||||
Ok(Json(json_response))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
[serve]
|
||||
# The address to serve on LAN.
|
||||
addresses = ["127.0.0.1"]
|
||||
addresses = ["127.0.0.1", "Brick"]
|
||||
# The address to serve on WAN.
|
||||
# address = "0.0.0.0"
|
||||
# The port to serve on.
|
||||
port = 8000
|
||||
|
||||
[[proxy]]
|
||||
backend = "http://localhost:8001/api"
|
||||
|
||||
Reference in New Issue
Block a user