File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,3 @@ const app = new Elysia({ adapter: node() })
1515 .get (' /' , () => ' Hello Node!' )
1616 .listen (3000 )
1717```
18-
19- ### Note
20- Node adapter is not feature complete yet. Some features are not supported, such as:
21- - not support ` ws ` method
Original file line number Diff line number Diff line change 11import { Elysia , file , sse } from 'elysia'
22import { cors } from '@elysiajs/cors'
3- import { openapi } from '@elysiajs/openapi'
3+ import { fromTypes , openapi } from '@elysiajs/openapi'
44
55import { node } from '../src'
66
@@ -27,11 +27,7 @@ const app = new Elysia({
2727 . post ( '/' , ( { body } ) => body , {
2828 parse : 'json'
2929 } )
30- . get ( '/' , ( { request } ) => {
31- console . log ( request )
32-
33- return 'ok'
34- } )
30+ . get ( '/' , ( ) => 'ok' )
3531 . listen ( 3000 )
3632
3733// console.log(app.fetch.toString())
Original file line number Diff line number Diff line change 11{
22 "name" : " @elysiajs/node" ,
3- "version" : " 1.4.1 " ,
4- "description" : " Plugin for Elysia for retreiving Bearer token " ,
3+ "version" : " 1.4.2 " ,
4+ "description" : " Elysia adapter to run Elysia on Node.js " ,
55 "license" : " MIT" ,
66 "scripts" : {
77 "dev" : " tsx --watch ./example/index.ts" ,
Original file line number Diff line number Diff line change @@ -157,11 +157,11 @@ export function createWebSocketAdapter() {
157157 store [ id ] = {
158158 data : context ,
159159 validateResponse,
160- ping ( data ?: unknown ) {
161- return options . ping ?.( data ) as number
160+ ping ( ws , data ?: unknown ) {
161+ return options . ping ?.( ws as any , data ) as number
162162 } ,
163- pong ( data ?: unknown ) {
164- return options . pong ?.( data ) as number
163+ pong ( ws , data ?: unknown ) {
164+ return options . pong ?.( ws as any , data ) as number
165165 } ,
166166 async open ( _ws ) {
167167 const ws = toServerWebSocket ( _ws , context )
You can’t perform that action at this time.
0 commit comments