Skip to content

Commit

Permalink
doc: add huggingface guide, modify vercel guide
Browse files Browse the repository at this point in the history
  • Loading branch information
imaegoo committed Dec 11, 2023
1 parent 4d08d7a commit 4f7e9ca
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions docs/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| [Railway 部署](#railway-部署) | ★★☆☆☆ | 有免费额度但不足以支持一个月连续运行,部署简单,适合全球访问。 |
| [Zeabur 部署](#zeabur-部署) | ★☆☆☆☆ | 需要绑定支付宝或信用卡,部署简单,适合中国大陆访问,免费计划环境随时可能会被删除。 |
| [Netlify 部署](#netlify-部署) | ★★★★☆ | 有充足的免费额度,中国大陆访问速度不错。 |
| [Hugging Face 部署](#hugging-face-部署) | ★☆☆☆☆ | 免费,不稳定,正在测试中 |
| [私有部署](#私有部署) | ★★☆☆☆ | 适用于有服务器的用户,需要自行申请 HTTPS 证书。 |
| [私有部署 (Docker)](#私有部署-docker) | ★★★☆☆ | 适用于有服务器的用户,需要自行申请 HTTPS 证书。 |

Expand Down Expand Up @@ -108,12 +109,16 @@ Vercel 部署的环境需配合 1.4.0 以上版本的 twikoo.js 使用
6. 申请 [Vercel](https://vercel.com/signup) 账号
7. 点击以下按钮将 Twikoo 一键部署到 Vercel<br>

[![](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/twikoojs/twikoo/tree/main/src/server/vercel-min)
[![Deploy](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/twikoojs/twikoo/tree/main/src/server/vercel-min)

8. 进入 Settings - Environment Variables,添加环境变量 `MONGODB_URI`,值为前面记录的数据库连接字符串
9. 进入 Deployments , 然后在任意一项后面点击更多(三个点) , 然后点击Redeploy , 最后点击下面的Redeploy
10. 进入 Overview,点击 Domains 下方的链接,如果环境配置正确,可以看到 “Twikoo 云函数运行正常” 的提示
11. Vercel Domains(包含 `https://` 前缀,例如 `https://xxx.vercel.app`)即为您的环境 id
9. 进入 Settings - Deployment Protection,设置 Vercel Authentication 为 Disabled,并 Save

![](./static/vercel-1.png)

10. 进入 Deployments , 然后在任意一项后面点击更多(三个点) , 然后点击 Redeploy , 最后点击下面的 Redeploy
11. 进入 Overview,点击 Domains 下方的链接,如果环境配置正确,可以看到 “Twikoo 云函数运行正常” 的提示
12. Vercel Domains(包含 `https://` 前缀,例如 `https://xxx.vercel.app`)即为您的环境 id

## Railway 部署

Expand Down Expand Up @@ -192,6 +197,14 @@ Netlify 免费等级(Functions Level 0)支持每月 125,000 请求次数和

13. 云函数地址(包含 `https://` 前缀和 `/.netlify/functions/twikoo` 后缀,例如 `https://xxx.netlify.app/.netlify/functions/twikoo`)即为您的环境 id

## Hugging Face 部署

::: warning 注意
正在测试中,文档待完善
:::

请参考 [https://github.com/twikoojs/twikoo/blob/main/src/server/huggingface-space/README.md](https://github.com/twikoojs/twikoo/blob/main/src/server/huggingface-space/README.md),更详细的文档会在未来版本中完善。

## 私有部署

::: warning 注意
Expand Down
Binary file added docs/static/hugging-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/hugging-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/vercel-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/server/vercel/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ async function commentSubmit (event, request) {
])
logger.log('POST_SUBMIT')
} catch (e) {
logger.error('POST_SUBMIT 失败', e)
logger.error('POST_SUBMIT 失败', e.message)
}
return res
}
Expand Down

0 comments on commit 4f7e9ca

Please sign in to comment.