1

I configured a static folder to be served by Javalin:

Javalin.create {
   it.addStaticFiles("/public")
}

In Javalin logs I see:

[main] INFO io.javalin.Javalin - Static file handler added:
{urlPathPrefix: "/", path: "/public", location: Location.CLASSPATH}
Resolved path: 'file:///Users/ls/projects/store/build/resources/main/public/'
[main] INFO io.javalin.Javalin - 

Which is fine. Files get served. But every time I change a JS/HTML/CSS file, I need to restart Javalin. Is there any way around this? I just wanted to refresh the browser for the sake of quick development.

Luís Soares
  • 5,726
  • 4
  • 39
  • 66

1 Answers1

3

You can use an external location (i.e not a "classpath" location) for your static files:

config.addStaticFiles("/path/to/external/folder", Location.EXTERNAL);

In that case, changes will be picked up without needing a Javalin restart.

andrewJames
  • 19,570
  • 8
  • 19
  • 51