Skip to main content
Home

@wsx/server@0.0.16
Built and signed on GitHub Actions

Server for Wsx framework. RPC, Pub/Sub, routing and end-to-end typesafety for WebSockets

This package works with Bun
This package works with Bun
JSR Score
100%
Published
a month ago (0.0.16)

Server for Wsx framework. RPC, Pub/Sub, routing and end-to-end typesafety for WebSockets

import { Wsx } from "@wsx/server"
import { z } from "zod"
import { db } from "./db" // your database service

export const app = new Wsx()
	.route(
	"/user/create",
	async ({ body: {email} }) => {
		const id = await db.createUser(email)
		return id
	},
	{
		body: z.object({ email: z.string() }),
		response: z.number().int(),
	},
	)
	.listen(3000)

More examples

Tip


Supports Standard Schema validators

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

bunx jsr add @wsx/server

Import symbol

import * as server from "@wsx/server";