Skip to content

Commit 13f726d

Browse files
committed
fix doc
1 parent bcf5743 commit 13f726d

File tree

5 files changed

+38
-52
lines changed

5 files changed

+38
-52
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
# SPA-SERVER
2+
23
[![GitHub Release](https://img.shields.io/github/release/ForNetCode/spa-server?color=brightgreen)](https://github.com/ForNetCode/spa-server/releases)
34
[![Build status](https://github.com/ForNetCode/spa-server/actions/workflows/spa-server-ci.yml/badge.svg)](https://github.com/ForNetCode/spa-server/actions/workflows/spa-server-ci.yml)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE)
56
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/ForNetCode/spa-server/graphs/commit-activity)
67
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/ForNetCode/spa-server/pulls)
78

8-
99
It provides a static web http server with cache and hot reload.
1010

1111
[中文说明](./README_CN.md)
1212

1313
## Feature
14-
- Built with Warp, fast and small!
15-
- SSL with Rustls.
16-
- Memory cache, client cache and compression(gzip).
14+
15+
- Built with Salvo, fast and small!
1716
- Static web version control, you can regress or release new version easily.
18-
- Hot reload support(Mac and Linux).
19-
- CORS support.
20-
- Http auto redirect to https.
2117
- Docker support(compressed size: ~26M)
2218
- Provide command line/npm package to deploy spa.
2319
- Multiple configs for different domain.
24-
- support Let's Encrypt
25-
- support OpenTelemetry Trace
2620
- provide JS SDK and command line client to interact with Server
2721

2822
## Document
23+
2924
There is a nice [Document](https://fornetcode.github.io/spa-server/) powered by VitePress and GitHub Pages,
3025
you can quickly start spa-server with this [Guide](https://fornetcode.github.io/spa-server/guide/getting-started.html).

README_CN.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,58 @@
11
# SPA-SERVER
2+
23
[![GitHub Release](https://img.shields.io/github/release/ForNetCode/spa-server?color=brightgreen)](https://github.com/ForNetCode/spa-server/releases)
34
[![Build status](https://github.com/ForNetCode/spa-server/actions/workflows/spa-server-ci.yml/badge.svg)](https://github.com/ForNetCode/spa-server/actions/workflows/spa-server-ci.yml)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE)
56
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/ForNetCode/spa-server/graphs/commit-activity)
67
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/ForNetCode/spa-server/pulls)
78

8-
99
专为静态页面提供全链路优化的托管服务。
1010

1111
[ENGLISH README](./README.md)
12+
1213
## 特性
13-
- 基于 Hyper 和 warp 构建。
14-
- SSL 基于 Rustls。
15-
- 服务器端缓存、客户端缓存(Cache-Content)、Gzip压缩。
14+
15+
- 基于 Salvo 构建。
1616
- SPA 版本管理, 仅需要一个 http 请求就能实现版本回滚和更新。
17-
- 支持热更新(Mac and Linux)。
18-
- 支持 CORS 跨域
19-
- http/https 同时服务(http 也可返回 redirect https)。
2017
- 支持 Docker 镜像(压缩后大小:~26M)
2118
- 提供 命令行/npm包 客户端,一行命令部署
2219
- 每个域名可拥有独立的配置
23-
- 支持 Let's Encrypt
24-
- 支持 OpenTelemetry
2520
- 提供JS SDK、命令行客户端与服务器进行交互。
2621

2722
## 文档
28-
中文 README 目前仅提供一些简易`快速使用`指引,更多内容可参考英文文档, 中文版会在后续有精力的时候做,其网站托管在 [GitHub Pages](https://fornetcode.github.io/spa-server)
23+
24+
中文 README 目前仅提供一些简易`快速使用`指引,更多内容可参考英文文档,
25+
中文版会在后续有精力的时候做,其网站托管在 [GitHub Pages](https://fornetcode.github.io/spa-server)
2926

3027
## 服务跑起来
3128

32-
配置文件说明: [`config.release.conf`](./config.release.conf).
29+
配置文件说明: [`config.release.conf`](./config.release.conf).
3330

3431
可以通过修改环境变量 `SPA_CONFIG=${config_path}`, 来更改配置文件地址。
3532

3633
### 通过源码
34+
3735
```shell
3836
git clone [email protected]:fornetcode/spa-server.git
3937
cd spa-server
40-
git submodule init && git submodule update
4138
cp config.release.toml config.toml # please remember to change `file_dir` in config.conf
4239
cargo run --bin spa-server
4340
```
4441

4542
### 通过镜像
43+
4644
```shell
4745
docker run -d -p 80 -v $HOST_VOLUME:/data -v $CONFIG:/config.conf ghcr.io/fornetcode/spa-server:latest
4846
```
4947

5048
## 如何部署静态文件
51-
如果你想集成到JS项目中,请参阅:[example/js-aapp-example](example/tmp/README.md)
52-
53-
## spa-server 使用场景
54-
### 单独使用
55-
根据自己的需求配置好 `cache`, 可获得极大的性能提升。 若需要热加载功能(ssl证书更替)/文件版本管理/客户端交互,请开启 `admin server` 配置。
56-
### 搭配 Nginx 使用
57-
请在默认配置的基础上,请对 `cache.compression, cache.client_cache, cors` 保持默认/禁用,相关配置所带来的功能可设定在Nginx端,预防本服务和Nginx出现冲突。
58-
### 高可用
59-
目前项目没有做高可用的适配,需要注意以下几点:
60-
1. 文件最好放在 S3/NFS 等可以共享到所有spa-server实例的文件系统中,否则 `Last-Modified` 不一致会对客户端缓存有一定影响。
61-
2. 所有控制请求,需要对每个实例都发起一遍。
6249

63-
## 项目规划
64-
请参阅 [项目规划](docs/develop/roadmap.md).
50+
如果你想集成到JS项目中,请参阅:[example/js-app-example](example/tmp/README.md)
6551

66-
## 为何自行维护 warp 版本
67-
[#171 Add reply::file(path) helper](https://github.com/seanmonstar/warp/issues/171)
52+
## 项目规划
6853

69-
本项目用了很多 warp/src/filters/fs.rs 的私有API。
54+
请参阅 [项目规划](docs/develop/roadmap.md).
7055

7156
## 项目起源
57+
7258
请跳转至 [SPA 发布辅助工具](https://github.com/timzaak/blog/issues/80) 浏览。

docs/develop/change-log.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Change Log
2+
23
### Version 3.0.0
3-
- rewrite, remove warp and cors, openTelemetry.
4+
5+
- rewrite, remove warp, cors, ssl and openTelemetry.
46
- bump deps.
7+
58
### Version 2.4.1
9+
610
- conf: spa-server: `cors` value bool to array string.
711
- improve: bump deps version.
812
- ci: jsclient can test auto.
913
- feat: remove openTelemetry trace.
10-
- jsclient: change info response to pure json
14+
- jsclient: change info response to pure json
1115

1216
### Version 2.4.0
1317

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# NPM Package
22

3-
## Install in new project
3+
## Install in a new project
44

55
```shell
66
npm install --save-dev spa-client
77
```
88

99
Use with `.env` and vars, we would run the following command:
10+
1011
```shell
1112
npm install --save-dev dotenv-cli cross-var spa-client
1213
```
14+
1315
the `pachage.json` would like:
16+
1417
```json
1518
{
1619
"scripts": {
@@ -21,7 +24,9 @@ the `pachage.json` would like:
2124
}
2225

2326
```
27+
2428
the `.env` would be like:
29+
2530
```angular2html
2631
# all config start with `SPA` for spa-client
2732
SPA_SERVER_ADDRESS=http://127.0.0.1:9000
@@ -41,8 +46,6 @@ There has more info at [getting started](./getting-started.md#run-spa-client-in-
4146
There id an example project for npm package users, you can view the package.json:
4247
[js-app-example](https://github.com/fornetcode/spa-server/tree/master/example/js-app-example).
4348

44-
45-
4649
## Build Source Code
4750

4851
```shell

docs/index.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sidebarDepth:2
55
# What is spa-server?
66

77
spa-server is to provide a static web http server with cache and hot reload.
8-
It supports multiple config for different domain, and has a client tool(npm package, command line) to help upload static
9-
web files to server.
8+
It supports multiple configs for different domains, and has a client tool(npm package, command line) to help upload
9+
static web files to server.
1010

1111
::: info Need Feedback
1212
sap-server features have been done, we are willing to get your feedback, fell free to
@@ -15,18 +15,16 @@ open [issues](https://github.com/fornetcode/spa-server/issues).
1515

1616
## Motivation
1717

18-
In my company, every single page application needs a nginx docker image, as time long, there containers takes lots of
19-
resources
20-
of memory and storage, and these nginx don't have proper config.
18+
In my company, every single page application needs a nginx docker image, as time-long, these containers take lots of
19+
resources of memory and storage, and these nginx don't have a proper config.
2120

22-
So I tried to develop a static web server to solve above problem, and create a client tool `spa-client` to help users to
23-
release
24-
SPA.
21+
So I tried to develop a static web server to solve the above problem, and create a client tool `spa-client` to help
22+
users to release SPA.
2523

2624
## Feature
2725

2826
- Built with Hyper and Salvo, fast and small!
29-
- Static web version control, you can regress or release new version easily.
27+
- Static web version control, you can regress or release a new version easily.
3028
- Docker support(compressed size: 32M).
3129
- Provide command line/npm package to deploy spa.
32-
- Multiple configs for different domain and Multiple SPA in on domain.
30+
- Multiple configs for different domains and Multiple SPA in on domain.

0 commit comments

Comments
 (0)