From 38afcf64cfbe8e436e24734e1b8b0a3877bd66e3 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Mon, 1 Nov 2021 15:58:02 +0800 Subject: [PATCH] docs: add usage in subpath --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ccecef4..09225f7 100644 --- a/README.md +++ b/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 - }, - { - "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