Add features: custom server and websocket. Minor refactoring
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import type { BunextConfig } from "../../dist/types";
|
||||
import { BunextWebsocket } from "./websocket";
|
||||
|
||||
const config: BunextConfig = {
|
||||
websocket: BunextWebsocket,
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { WebSocketHandler } from "bun";
|
||||
|
||||
export const BunextWebsocket: WebSocketHandler<any> = {
|
||||
message(ws, message) {
|
||||
console.log(`WS Message => ${message}`);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user