File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ Now modifying any file in your web app (whether it's a .v file with the backend
2020or a compiled .html template file) will result in an instant refresh of your app
2121in the browser. No need to quit the app, rebuild it, and refresh the page in the browser!
2222
23+ Note: this works by injecting a small ` <script> ` tag before the ending ` </html> ` tag of the page,
24+ that will check periodically if the current page has to be reloaded. In other words, it works for
25+ template pages that have that ` </html> ` tag, or for ones that were produced by ` ctx.html() ` and that
26+ also have that closing tag, but not for ones produced by ` ctx.text() ` .
27+
2328## Deploying veb apps
2429
2530All the code, including HTML templates, is in one binary file. That's all you need to deploy.
6368
6469// This is how endpoints are defined in veb. This is the index route
6570pub fn (app &App) index(mut ctx Context) veb.Result {
66- return ctx.text(' Hello V! The secret key is "${app.secret_key}"')
71+ return ctx.html('<html><body><h1> Hello V!</h1><p> The secret key is "${app.secret_key}"</body></html> ')
6772}
6873
6974fn main() {
You can’t perform that action at this time.
0 commit comments