SPAs support using asset handler
In jooby 2.0, assets("/?*") should work like a site, meaning assets not found in the filesystem or classpath, should return index.html.
The key difference is the /?* mapping. This mapping add support for base root mapping:
* GET /docs ⇒ /docs/index.html
* GET /docs/about.html ⇒ /docs/about.html
* GET /docs/note ⇒ /docs/index.html
But the way AssetHandler is implement, the third case (GET /docs/note ⇒ /docs/index.html) does not work, return 404.
My suggestion is that assets not found should not return 404 but continue to flow in the chain of routes. What do you think?
There is no concept of chain of route in 2.x... or it is not like in 1.x
In 2.x an asset mapping (or any other mapping) must resolve the response or trigger a 404 (in case of asset handler).
Then this:
GET /docs/note
Must be resolved to:
/docs/note/index.html
Not: /docs/index.html
isn't working?
Actually what I need in my use case is:
GET /docs/note -> /docs/index.html or any asset that does not exist, fallback to index.html
Without the chain concept, how can I achieve this?