docs: add usage in subpath
parent
c027d486c1
commit
38afcf64cf
48
README.md
48
README.md
|
@ -33,17 +33,28 @@ sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"
|
|||
## Config
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"path": "configui.log",
|
||||
"ro": true
|
||||
},
|
||||
"app_name": "ConfigUI",
|
||||
"base_url": "/",
|
||||
"config_path": "conf.json",
|
||||
"no_reconfig": false,
|
||||
"allow_ip": "",
|
||||
"files": [
|
||||
{
|
||||
"path": "etc/test.ini",
|
||||
"name": "test",
|
||||
"action": "myip local -P"
|
||||
"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
|
||||
|
|
Loading…
Reference in New Issue