@exotjs/bun
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Bun integration for Exot Inspector

This repository contains the WebSocket server implementation for Bun, enabling direct connection of the Exot Inspector App to your server.

Install

bun add @exotjs/inspector @exotjs/bun

Usage

import { Inspector } from '@exotjs/inspector';
import { MemoryStore } from '@exotjs/inspector/store';
import { websocket } from '@exotjs/bun';

const inspector = new Inspector({
  store: new MemoryStore(),
});

Bun.serve({
  ...websocket({
    inspector,
  }),
  port: 3003,
});

Configuration

The websocket() function accepts the following configuration parameters:

authorize: (req, server) => Promise<string> | string

Configure the authorize function to inspect the incoming request and authorize the user. It should return the user's name from the function or throw an error if unauthorized.

inspector: Inspector (required)

Provide an instance of Inspector.

path: string

Configure the path for the WebSocket server (default is /_inspector).

Contributing

See Contributing Guide and please follow our Code of Conduct.

License

MIT

Package Sidebar

Install

npm i @exotjs/bun

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

6.2 kB

Total Files

7

Last publish

Collaborators

  • ovx