Skip to content

Commit 013019b

Browse files
committed
🔧 fix: update package version
1 parent 9f1116e commit 013019b

4 files changed

Lines changed: 8 additions & 16 deletions

File tree

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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

example/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Elysia, file, sse } from 'elysia'
22
import { cors } from '@elysiajs/cors'
3-
import { openapi } from '@elysiajs/openapi'
3+
import { fromTypes, openapi } from '@elysiajs/openapi'
44

55
import { 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())

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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",

src/ws.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)