Serving a SPA along side an API #1472
-
My design requirements are
I've tried configuring my router like this let app = Router::new()
.nest(
"/api/v1",
Router::new().nest(
"/auth",
Router::new().route("/login", post(auth::login)),
),
)
.route("/*rest", get(gui::static_handler)); but the
Is it not possible for me to register a set of API routes and then anything that's not matched get's handled by the gui handler? The gui handler does work as expected when the API routes are disabled. |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Oct 10, 2022
Replies: 1 comment
-
Use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
clarkmcc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
Router::fallback
instead.