From d80c18a5b770aba974b323d9b8d51816aeb7b7b7 Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 7 Jun 2021 19:08:34 -0500 Subject: [PATCH] add spa docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 94dc937..b95ea1b 100644 --- a/README.md +++ b/README.md @@ -155,13 +155,13 @@ User can also turn stdout log on with `--logger.stdout`. It won't affect the fil ## Assets Server -Users may turn the assets server on (off by default) to serve static files. As long as `--assets.location` set it treats every non-proxied request under `assets.root` as a request for static files. The assets server can be used without any proxy providers; in this mode, reproxy acts as a simple web server for the static content. +Users may turn the assets server on (off by default) to serve static files. As long as `--assets.location` set it treats every non-proxied request under `assets.root` as a request for static files. The assets server can be used without any proxy providers; in this mode, reproxy acts as a simple web server for the static content. Assets server also supports "spa mode" with `--assets.spa` where all not-found request forwarded to `index.html`. In addition to the common assets server, multiple custom assets servers are supported. Each provider has a different way to define such a static rule, and some providers may not support it at all. For example, multiple asset servers make sense in static (command line provider), file provider, and even useful with docker providers, however it makes very little sense with consul catalog provider. -1. static provider - if source element prefixed by `assets:` it will be treated as file-server. For example `*,assets:/web,/var/www,` will serve all `/web/*` request with a file server on top of `/var/www` directory. -2. file provider - setting optional field `assets: true` -3. docker provider - `reproxy.assets=web-root:location`, i.e. `reproxy.assets=/web:/var/www`. +1. static provider - if source element prefixed by `assets:` it will be treated as file-server. For example `*,[assets|spa]:/web,/var/www,` will serve all `/web/*` request with a file server on top of `/var/www` directory. +2. file provider - setting optional fields `assets: true` or `spa:true` +3. docker provider - `reproxy.assets=web-root:location`, i.e. `reproxy.assets=/web:/var/www`. Switching to spa mode done by setting `reproxy.spa` to `1`, `yes` or `true` Assets server supports caching control with the `--assets.cache=` parameter. `0s` duration (default) turns caching control off. A duration is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h" and "d".