docs: add usage in subpath

feat/muzan
Evan Chen 2021-11-01 15:58:02 +08:00
parent c027d486c1
commit 38afcf64cf
1 changed files with 43 additions and 11 deletions

View File

@ -33,17 +33,28 @@ sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"
## Config
```json
[
{
"path": "configui.log",
"ro": true
},
{
"path": "etc/test.ini",
"name": "test",
"action": "myip local -P"
}
]
{
"app_name": "ConfigUI",
"base_url": "/",
"config_path": "conf.json",
"no_reconfig": false,
"allow_ip": "",
"files": [
{
"path": "main.go",
"name": "GoPlayground",
"action": "go run main.go",
"ro": false,
"lang": "",
"order": 0,
"data": ""
}
],
"result_bellow": false,
"hide_config": false,
"log_path": "access.log",
"silent_sys_out": false
}
```
`configui -f PATH/TO/CONFIG`
@ -64,6 +75,27 @@ Restart=always
WantedBy=multi-user.target
```
## Use as a sub route
```go
cui.BaseUrl = "/configui/"
mux := http.NewServeMux()
mux.Handle("/configui/", http.StripPrefix("/configui", cui))
```
## Use as subpath in caddy
```caddyfile
DOMAIN {
...
route /configui/* {
uri strip_prefix /configui
reverse_proxy localhost:8000
}
...
}
```
## Api
### Files