logo
0
0
WeChat Login
[update]: Update README.md
# Chathub Server (Worker Version) The Chathub Server is the backend service for the [Chathub](https://cnb.cool/tryandrun/web_dev/chat_hub/chathub) project. It provides an API for managing chat sessions and messages and is designed to be deployed on **Cloudflare Workers**, enabling a serverless, edge-based architecture. ## Prerequisites - [Bun](https://bun.sh/) installed - [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-AND-update/) CLI installed - A Cloudflare account ## Installation Install the project dependencies using Bun: ```sh bun install

Deployment

To deploy the worker to Cloudflare, follow these steps:

  1. Prepare the environment:
    Ensure the public directory exists (required for static assets).

    mkdir public
  2. Start local development (Optional):

    ./scripts/dev_start. sh
  3. Generate Types:

    bunx wrangler types
  4. Deploy to Cloudflare:

    bunx wrangler deploy

Important Note: This worker depends on external services. You must deploy chathub, cf-worker-token-server, and cf-worker-totp concurrently to ensure the token and TOTP servers are accessible for the Chathub server to function correctly.

Related Projects