feature: support .spa files for Single Page Apps

This commit is contained in:
Andy Burke 2025-11-20 16:44:49 -08:00
parent 604090d8b8
commit 9fc91f4cf4
11 changed files with 329 additions and 8 deletions

View file

@ -69,6 +69,19 @@ listening.
- `SERVERUS_PUT_PATHS_ALLOWED`: a list of ;-separated directories for which file uploads via PUT are allowed
- `SERVERUS_DELETE_PATHS_ALLOWED`: a list of ;-separated directories for which file deletions via DELETE are allowed
### Singe-Page Applications (SPA)
If you place a `.spa` file under the root, that directory will try to return an `index.html` or `index.htm` file that lives in it for any requests that are relative to it. For example:
```
www/
app/
.spa
index.html
```
If you have this file structure (assuming `www` is the root), a `GET` to `/app/foo/bar` will return the `index.html` file in the `app/` directory. (Which would then presumably handle the url in `window.location` appropriately.)
### Typescript Handling
These types and interface define the default serverus Typescript handler's expected