Files
revanced-bots/apis/websocket/docs/2_running.md
PalmDevs b3b7723b4f feat!: big feature changes
BREAKING CHANGES:
- Heartbeating removed
- `config.consoleLogLevel` -> `config.logLevel`

NEW FEATURES:
- Training messages
- Sequence number system
- WebSocket close codes used instead of disconnect packets

FIXES:
- Improved error handling
- Some performance improvements
- Made code more clean
- Updated dependencies
2024-06-24 18:23:27 +07:00

1.3 KiB

🏃🏻‍♂️ Running the server

There are many methods to run the server. Choose one that suits best for the situation.

There will be no compilation step, and Bun will automatically watch changes and restart the server for you.

You can quickly start the server by running:

bun dev

🌐 Production mode

Production mode runs no different from the development server, it simply has less debugging information printed to console by default. However, more production-specific features may come.

To start the server in production mode, you'll have to:

  1. Set the NODE_ENV environment variable to production

    It is very possible to set the value in the .env file and let Bun load it, but it is recommended to set the variable before Bun even starts.

  2. Start the server

    bun dev
    

📦 Building

If you're looking to build and host the server somewhere else, you can run:

bun bundle

The files will be placed in the dist directory. Configurations and .env files will NOT be copied automatically.
You can run these files using the command bun run index.js.

⏭️ What's next

The next page will tell you about packets.

Continue: 📨 Packets