diff --git a/config.release.toml b/config.release.toml index d1d9684..f210984 100644 --- a/config.release.toml +++ b/config.release.toml @@ -5,6 +5,7 @@ file_dir = "/data" ## Access-Control-Allow-Origin: $ORIGIN ## Access-Control-Allow-Methods: OPTION,GET,HEAD ## Access-Control-Max-Age: 3600 +## If you put the server behind HTTPS proxy, please enable it cors = false ## http bind, if set port <= 0 or remove http, will disable http server(need set https config) [http] diff --git a/docs/develop/roadmap.md b/docs/develop/roadmap.md index 1631514..9f0b223 100644 --- a/docs/develop/roadmap.md +++ b/docs/develop/roadmap.md @@ -4,4 +4,4 @@ - bench: add benchmark - admin server support HTTPS -- openTelemetry \ No newline at end of file +- ~~openTelemetry~~ \ No newline at end of file diff --git a/docs/guide/spa-client-npm-package.md b/docs/guide/spa-client-npm-package.md index b8e407e..04adf89 100644 --- a/docs/guide/spa-client-npm-package.md +++ b/docs/guide/spa-client-npm-package.md @@ -5,11 +5,44 @@ ```shell npm install --save-dev spa-client ``` -there has more info at [getting started](./getting-started.md#run-spa-client-in-npm-package) + +Use with `.env` and vars, we would run the following command: +```shell +npm install --save-dev dotenv-cli cross-var spa-client +``` +the `pachage.json` would like: +```json +{ + "scripts": { + "upload": "dotenv cross-var spa-client upload ./build %DOMAIN%", + "release": "dotenv cross-var spa-client release %DOMAIN%", + "deploy": "npm run build && npm run upload && npm run release" + } +} + +``` +the `.env` would be like: +```angular2html +# all config start with `SPA` for spa-client +SPA_SERVER_ADDRESS=http://127.0.0.1:9000 + +# spa server token +SPA_SERVER_AUTH_TOKEN=token + +# default is 3 +SPA_UPLOAD_PARALLEL=3 + +#DOMAIN=www.example.com/a +DOMAIN=www.example.com +``` + +There has more info at [getting started](./getting-started.md#run-spa-client-in-npm-package) There id an example project for npm package users, you can view the package.json: [js-app-example](https://github.com/fornetcode/spa-server/tree/master/example/js-app-example). + + ## Build Source Code ```shell diff --git a/docs/guide/spa-server-configuration.md b/docs/guide/spa-server-configuration.md index 1afead6..5af05ad 100644 --- a/docs/guide/spa-server-configuration.md +++ b/docs/guide/spa-server-configuration.md @@ -4,7 +4,7 @@ The config format toml. -The config default path is './config.conf', you can change it by environment `SPA_CONFIG`. +The config default path is `./config.toml`, you can change it by environment `SPA_CONFIG`. ## Config Reference @@ -18,6 +18,7 @@ file_dir = "/data" ## Access-Control-Allow-Origin: $ORIGIN ## Access-Control-Allow-Methods: OPTION,GET,HEAD ## Access-Control-Max-Age: 3600 +## If you put the server behind HTTPS proxy, please enable it cors = false ## http bind, if set port <= 0 or remove http, will disable http server(need set https config) [http] diff --git a/docs/guide/spa-server-release-package.md b/docs/guide/spa-server-release-package.md index d6cd973..94bc4dc 100644 --- a/docs/guide/spa-server-release-package.md +++ b/docs/guide/spa-server-release-package.md @@ -1,7 +1,10 @@ # spa-server distribution package ## Docker Image -The docker image is distributed at `Github Packages` as `ghcr.io/fornetcode/spa-server`. +The docker image is distributed at `Github Packages` as [`ghcr.io/fornetcode/spa-server`](https://github.com/fornetcode/spa-server/pkgs/container/spa-server). +```shell +docker pull ghcr.io/fornetcode/spa-server:latest +``` ## From Code There no plan to release binary package. You can `git clone` the code and build yourself.