Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremybanka/bun-ws-railway
https://github.com/jeremybanka/bun-ws-railway
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeremybanka/bun-ws-railway
- Owner: jeremybanka
- Created: 2024-01-29T10:27:22.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-29T10:27:24.000Z (12 months ago)
- Last Synced: 2024-11-08T06:56:29.682Z (2 months ago)
- Language: TypeScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bun WebSockets
A simple WebSocket server to get started using Bun.
![](../../actions/workflows/ci.yml/badge.svg)
[![](https://railway.app/button.svg)](https://railway.app/template/BLofAq?referralCode=bonus)
## Prerequisites
- [ Bun](https://bun.sh/) `>=1.0.0`
- [All-in-one toolkit](https://bun.sh/blog/bun-v1.0#bun-is-an-all-in-one-toolkit)
- [JavaScript runtime](https://bun.sh/blog/bun-v1.0#bun-is-a-javascript-runtime)
- [Package manager](https://bun.sh/blog/bun-v1.0#bun-is-a-package-manager)
- [Test runner](https://bun.sh/blog/bun-v1.0#bun-is-a-test-runner)
- [Bundler](https://bun.sh/blog/bun-v1.0#bun-is-a-bundler)## Getting Started
1. **[Deploy on Railway](https://railway.app/template/BLofAq?referralCode=bonus)** or **[use this template](https://github.com/dayblox/bun-ws/generate)**
2. **Clone** the repository
3. **Install** dependencies
```sh
bun i
```## Usage
- **Development** mode (**debug**)
`F5`
- Connecting to the Server using a WebSocket client
```sh
bunx wscat -c ws://localhost:3000
```- Running **tests** (**watch** mode)
```sh
bun test --watch
```- **Production** mode
```sh
bun src/index.ts
```