This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Docs | |
| ## LobeChat | |
| ## https://lobehub.com/zh/docs/self-hosting/server-database/docker | |
| ## https://lobehub.com/zh/docs/self-hosting/advanced/online-search | |
| ## docker command | |
| ``` | |
| root@japan:~# touch lobe-chat.env | |
| root@japan:~# nano lobe-chat.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function handleRequest(request, env) { | |
| const { pathname, search } = new URL(request.url); | |
| const [_, token, action, user, ...params] = pathname.split('/'); | |
| if (!token || !action) | |
| throw 'Invalid request'; | |
| // register or refresh user's token | |
| if (action === 'register') { | |
| // validate against master token | |
| if (token !== env.ACCESS_TOKEN || !user) |