XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

Add /private/ route to GUI server (#3195)

* Initial plan * Add /private/ route to GUI server Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

81f5f32a
Copilot <198982749+Copilot@users.noreply.github.com>
提交于

代码差异

1 个文件 +12 -0
Modified g4f/gui/server/website.py +12 -0
@@ -98,6 +98,14 @@ class Website:
98 98 'function': self._chat,
99 99 'methods': ['GET', 'POST']
100 100 },
101 '/private/': {
102 'function': self._private,
103 'methods': ['GET', 'POST']
104 },
105 '/private/<path:filename>': {
106 'function': self._private,
107 'methods': ['GET', 'POST']
108 },
101 109 '/media/': {
102 110 'function': redirect_home,
103 111 'methods': ['GET', 'POST']
@@ -129,6 +137,10 @@ class Website:
129 137 filename = f"chat/{filename}" if filename else "chat/index"
130 138 return render(filename)
131 139
140 def _private(self, filename = ""):
141 filename = f"private/{filename}" if filename else "private/index"
142 return render(filename)
143
132 144 def _dist(self, name: str):
133 145 return send_from_directory(os.path.abspath(DIST_DIR), name)
134 146