{{ .Output }}
+ diff --git a/README.md b/README.md index 63e627e..6a3c3d8 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ **This project is part of Dragon's Zone HomeLab** -This project focuses on functional implementation and does not consider any performance optimizations or large-scale deployment scenarios. Any issues arising from this are not related to the project. +This project focuses on functional implementation and does not consider any performance optimizations or large-scale +deployment scenarios. Any issues arising from this are not related to the project. -**Note**: The project recently added custom renderers and reverse proxy functionality, which may lead to serious security and performance issues. If not needed, it can be turned off in the settings. +**Note**: The project recently added custom renderers and reverse proxy functionality, which may lead to serious +security and performance issues. If not needed, it can be turned off in the settings. ## Get Started @@ -29,15 +31,13 @@ For specific configurations, check [`config.yaml`](./config.yaml). Create `.pages.yaml` in the project's `gh-pages` branch and fill in the following content: ```yaml -v-route: true # Virtual routing alias: # CNAME - "example.com" - "example2.com" -templates: # Renderer - gotemplate: '**/*.tmpl,**/index.html' -proxy: - /api: https://github.com/api -ignore: .git/**,.pages.yaml +routes: + - path: "**" + js: + exec: index.js ``` ## TODO diff --git a/README_zh.md b/README_zh.md index 0f8f90f..2bafeb2 100644 --- a/README_zh.md +++ b/README_zh.md @@ -29,15 +29,13 @@ make gitea-pages 在项目的 `gh-pages` 分支创建 `.pages.yaml`,填入如下内容 ```yaml -v-route: true # 虚拟路由 alias: # CNAME - "example.com" - "example2.com" -templates: # 渲染器 - gotemplate: '**/*.tmpl,**/index.html' -proxy: - /api: https://github.com/api -ignore: .git/**,.pages.yaml +routes: + - path: "**" + js: + exec: index.js ``` ## TODO diff --git a/examples/HelloWorld/index.html b/examples/HelloWorld/index.html index 719c0fb..301f4ab 100644 --- a/examples/HelloWorld/index.html +++ b/examples/HelloWorld/index.html @@ -5,7 +5,7 @@ -
Hello World
diff --git a/examples/QuickJS/.pages.yaml b/examples/JS/.pages.yaml similarity index 72% rename from examples/QuickJS/.pages.yaml rename to examples/JS/.pages.yaml index 07b9ebf..d2c0ea4 100644 --- a/examples/QuickJS/.pages.yaml +++ b/examples/JS/.pages.yaml @@ -1,8 +1,8 @@ routes: - path: "api/dev/**" - qjs: + js: exec: "index.js" debug: true - path: "api/prod/**" - qjs: + js: exec: "json.js" \ No newline at end of file diff --git a/examples/QuickJS/index.html b/examples/JS/index.html similarity index 86% rename from examples/QuickJS/index.html rename to examples/JS/index.html index 7a6795a..b77ec73 100644 --- a/examples/QuickJS/index.html +++ b/examples/JS/index.html @@ -5,7 +5,7 @@ -{{ .Output }}
+ {{ .Time.Format "2006/01/02 15:04:05" }} - {{ .Level }} : {{ .Message }}
{{- end }}{{ $key }} = {{ $value }}
{{- end }}Message:`
- var q *quickjs.Error
- if errors.As(jsError, &q) {
- html += q.Message + ""
- html += `Stack:` + q.Stack
- } else {
- html += jsError.Error()
- }
-
- html += `