Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
timzaak committed Sep 3, 2024
1 parent c619207 commit 6709ff5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions config.release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

- bench: add benchmark
- admin server support HTTPS
- openTelemetry
- ~~openTelemetry~~
35 changes: 34 additions & 1 deletion docs/guide/spa-client-npm-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/spa-server-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion docs/guide/spa-server-release-package.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit 6709ff5

Please sign in to comment.