HTTP Endpoints for paths beyond 'api'

As of now, you only have control over requests sent to https://something.anvil.app/_/api
However, you cannot handle requests sent to https://something.anvil.app/_/anything. It will be really helpful if Anvil adds this feature.

The reason for this request is Server Side Routing Attempt

In cases of server-side routing, Having api in every path just makes them appear longer and less normal.

Also, if possible, can we please have the option of letting apps handle 404 their own way (if they want to). For example, if you currently go to https://something.anvil.app/path, you will see the usual ‘App Not Found’ page from Anvil.

Maybe we can instead have a specific decorator for such endpoints or simply let them redirect you to the main app.

Thanks

Related:

I guess this also highlights one potential limitation on being able to handle requests for any path. The Users service handles reset_password paths (and unfortunately still handles expired links poorly).

1 Like

I suppose a universal handler for all missing paths will not be enough for your case. But it will still be better than the ‘App Not Found’ page.

Also, before making this post, I also wanted to provide a link to your post in it but I couldn’t find it at that time.

1 Like