Skip to content

Commit 95dc03c

Browse files
committed
finish doc and prepare to release v2.1.1
1 parent 7e0943d commit 95dc03c

8 files changed

+55
-20
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spa-client"
3-
version = "2.0.0"
3+
version = "2.1.1"
44
edition = "2021"
55
authors = ["timzaak"]
66
license = "MIT"

docs/develop/change-log.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Version 2.1.1
44

55
- [x] fix: cache discard correctly
6-
- [ ] feat: server could start should serve old version
6+
- [x] feat: server could start should serve old version
77
- [x] improve: .SPA-Multiple file create when upload
88

99
### Version 2.1.0

docs/develop/roadmap.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
- bench: add benchmark
66
- doc: spa-client command help doc
77
- [x] integration check of files list
8-
- config format change from honcon to yaml (honcon lib is archived)
8+
- **big break change**: config format change from honcon to yaml (honcon lib is archived)
9+
- support Let's Encrypt with [acme-lib](https://crates.io/crates/acme-lib)

docs/guide/getting-started.md

+26-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Getting Started
2+
23
This section will help you bring spa-server up, and upload your static web files to it.
34

45
## Run spa-server by docker
6+
57
`uploading file` feature needs spa-server open admin-server. So we should create a config file first.
68

79
```bash
@@ -22,11 +24,15 @@ ghcr.io/fornetcode/spa-server:latest
2224
```
2325

2426
## Run spa-client in npm project
27+
2528
1. Install spa-client npm package.
29+
2630
```shell
2731
npm install spa-client dotenv --save-dev
2832
```
33+
2934
2. add config for spa-client in the `.env` file
35+
3036
```
3137
# all config start with `SPA` for spa-client
3238
SPA_SERVER_ADDRESS=http://127.0.0.1:9000
@@ -37,20 +43,35 @@ SPA_SERVER_AUTH_TOKEN=token
3743
SPA_UPLOAD_PARALLEL=3
3844
```
3945

40-
3. Add script to package.json (need `dotenv`). `www.example.com` is the domain of your website, and `./build` is directory of static web files.
46+
3. Add script to package.json (need `dotenv`). `www.example.com` is the domain of your website, and `./build` is
47+
directory of static web files.
4148

4249
```json
4350
{
44-
"script":{
45-
"upload": "dotenv .env spa-client upload ./build www.example.com",
46-
"release":"dotenv .env spa-client release www.example.com"
51+
"script": {
52+
"upload": "dotenv .env spa-client upload ./build www.example.com",
53+
"release": "dotenv .env spa-client release www.example.com"
4754
}
4855
}
4956
```
5057

58+
we also support serving multiple SPA in one domain:
59+
60+
```json
61+
{
62+
"script": {
63+
"upload1": "dotenv .env spa-client upload ./build www.example.com/a",
64+
"release1": "dotenv .env spa-client release www.example.com/a",
65+
"upload2": "dotenv .env spa-client upload ./build www.example.com/b",
66+
"release2": "dotenv .env spa-client release www.example.com/b"
67+
}
68+
}
69+
```
5170

5271
## What's More
53-
- a React example for spa-client: [js-app-example](https://github.com/fornetcode/spa-server/blob/master/example/js-app-example/README.md).
72+
73+
- a React example for
74+
spa-client: [js-app-example](https://github.com/fornetcode/spa-server/blob/master/example/js-app-example/README.md).
5475
- spa-server [configuration](./spa-server-configuration.md) and its admin-server [http api](./spa-server-api.md)
5576
- spa-client [npm package](./spa-client-npm-package.md)
5677

docs/guide/spa-client-command-line.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
# Command Line
2-
We have provided command line in 1.x versions, but it seems no one need it. So we removed the binary release and docker release.
2+
3+
We have provided command line in 1.x versions, but it seems no one need it. So we removed the binary release and docker
4+
release.
35

46
But you can build it from source.
57

68
## Source Code
9+
710
```shell
811
git clone --recursive https://github.com/fornetcode/spa-server
912
cargo build --package spa-client --release
1013
# you could get the binary from ./target/release directory
1114
```
12-
You can install it by:
15+
16+
Install it by:
17+
1318
```shell
1419
cd client
1520
cargo install --bin spa-client --path .
1621
```
1722

1823
## Overview
24+
1925
spa-client it a command line tool to help user upload files and release new SPA.
2026

2127
## Usage Example
28+
2229
There are some usage examples of `spa-client`, you also can get help by typing `spa-client -h`.
30+
2331
```shell
2432
# upload static files to admin server, if not set $OPT_VERSION, will try to
2533
spa-client -c $CONFIG_PATH upload $STATIC_FILE_PATH $DOMAIN $OPT_VERSION -p 3
@@ -37,9 +45,8 @@ spa-client -c $CONFIG_PATH reload
3745
spa-client -c $CONFIG_PATH delete $OPT_DOMAIN $OPT_MAX_RESERVE
3846
```
3947

40-
There also provides http api to interact with admin server,
41-
4248
### Config
49+
4350
the config file format is hocon:
4451

4552
```hocon
@@ -57,7 +64,10 @@ upload {
5764
parallel: 3
5865
}
5966
```
60-
the config file name would be `client.conf`
67+
68+
the config default file name is `client.conf`.
69+
70+
We also provide http api to interact with admin server, the following command is ok to upload and serve new version.
6171

6272
```shell
6373
# Uploading Files By scp and release

docs/guide/spa-client-npm-package.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# NPM Package
2-
## Overview
32

4-
There has an example project for npm package users:
5-
[js-app-example](https://github.com/fornetcode/spa-server/tree/master/example/js-app-example).
3+
## Overview
64

75
## Install in new project
6+
87
there is more info at [getting started](./getting-started.md#run-spa-client-in-npm-package)
98

10-
## Source Code
9+
There has an example project for npm package users:
10+
[js-app-example](https://github.com/fornetcode/spa-server/tree/master/example/js-app-example).
11+
12+
## Build Source Code
13+
1114
```shell
1215
git clone --recursive https://github.com/fornetcode/spa-server
1316
cd jsclient && npm install && npm build

server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spa-server"
3-
version = "2.0.0"
3+
version = "2.2.1"
44
edition = "2021"
55
authors = ["timzaak"]
66
license = "MIT"

0 commit comments

Comments
 (0)