Proxy vite dev server (#10)

* refactor: pass reqwest from tuono_lib crate and prepared vite_reverse_proxy

* feat: add proxy entry point on vite side

* refactor: internal_handlers_folder

* feat: handle vite websocket tunnel

* feat: handle unexpect WebSocket messages

* feat: split dev/prod ssr handling

* feat: split js/rust bundle reloading

* feat: prevent close error on websocket connection

* feat: remove vite proxy on prod server

* feat: update version to v0.4.0
This commit is contained in:
Valerio Ageno
2024-07-07 11:44:36 +02:00
committed by GitHub
parent 9cd90ba62a
commit 672e4b69d7
22 changed files with 257 additions and 71 deletions
+2 -3
View File
@@ -11,13 +11,12 @@ pub fn handler_core(_args: TokenStream, item: TokenStream) -> TokenStream {
use tuono_lib::axum::response::IntoResponse;
use std::collections::HashMap;
use tuono_lib::axum::extract::{State, Path};
use reqwest::Client;
#item
pub async fn route(
Path(params): Path<HashMap<String, String>>,
State(client): State<Client>,
State(client): State<tuono_lib::reqwest::Client>,
request: tuono_lib::axum::extract::Request
) -> impl IntoResponse {
let pathname = &request.uri();
@@ -30,7 +29,7 @@ pub fn handler_core(_args: TokenStream, item: TokenStream) -> TokenStream {
pub async fn api(
Path(params): Path<HashMap<String, String>>,
State(client): State<Client>,
State(client): State<tuono_lib::reqwest::Client>,
request: tuono_lib::axum::extract::Request
) -> impl IntoResponse{
let pathname = &request.uri();