pub async fn render_views(req: HttpRequest) -> HttpResponse
Expand description
takes a request to, say, www.you_webapp.com/foo/bar
and looks in the ./backend/views folder
for a html file/template at the matching path (in this case, ./foo/bar.html),
defaults to index.html
then, your frontend (all the css files, scripts, etc. in your frontend’s vite manifest (at ./frontend/dist/manifest.json))
will be compiled and injected into the template wherever {{ bundle(name="index.tsx") }}
is (the index.tsx
can be any .tsx file in ./frontend/bundles)
then, that compiled html is sent to the client
NOTE the frontend/dist/manifest.json file referenced is generated in the frontend when it compiles
§Panics
- the mutex lock is poisoned