Template "hot reload"
See original GitHub issueI’m testing a dummy template as follows:
.get("/test", ctx -> ctx.render("templates/test.mustache", new HashMap<>()));
Editing the template (test.mustache) requires restarting the app (or maybe rebuilding the app, but stop + run in Eclipse anyway).
It’s a major use case to be able to work with a template without a need of restarting the Javalin app for every change. I even tried to add .enableStaticFiles(“src/resources/templates”, Location.EXTERNAL), but no luck.
Is this a feature? Works differently in SparkJava by the way.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Sample app that demonstrates enabling hot reload for Marko ...
Marko Sample - Hot Reloading. Marko provides a hot-reloading feature that allows templates to automatically be reloaded without a restart.
Read more >Reload Flask app when template file changes - Stack Overflow
To reload your application when the templates change (or any other file), you can pass the extra_files argument to Flask().run() , a collection...
Read more >84. Hot swapping - Spring
There are several options for hot reloading. ... They will, however, trigger a live reload. ... 84.2 Reload templates without restarting the container....
Read more >Hot Reload ignoring DataTemplate change
To repeat the problem run the enclosed application, click edit mode, then click insert text, then select new text, click add animation, fade...
Read more >handlebars-hot-reload - npm
This CLI aims to render handlebar templates with hot reload functionality for ease of development of handlebar templates.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happy you found a solution @valtterip!
Instead of doing it “manually” per request, you could register a new
FileRenderer
:Then you could use Javalin like normal, with calls to
ctx.render(...)
.I don’t think anything template-specific should be included in Javalin, other than a minimal example implementation that can be overridden by the user.
I agree, but thank you for documenting your solution here. I’ve added the info tag.