jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.7k stars 199 forks source link

router: change assets return type from `Route` to `AssetHandler` #3504

Closed jknack closed 4 weeks ago

jknack commented 4 weeks ago

So it can be easily configured when need it.

Instead of:

assets("/path", new AssetHandler(AssetSource.create("path")).setMaxAge(Duration.ofDays(365)));

Now we get:

  assets("/path", "path")
     .setMaxAge(Duration.ofDays(365)