File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed
Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 11# 1.2.4 - 9 Jan 2024
22Bug fix:
33- Support Elysia 1.2.11
4+ - [ #15 ] ( https://github.com/elysiajs/node/issues/15 ) Possibly fix ` ReadableStream ` duplex issue?
45- [ #14 ] ( https://github.com/elysiajs/node/issues/14 ) ReadableStream has already been used if request is reference multiple time
56
67# 1.2.3 - 27 Dec 2024
Original file line number Diff line number Diff line change 11import { Elysia } from 'elysia'
22import { node } from '../src'
3-
4- const plugin = new Elysia ( { prefix : '/api/v1' } ) . post (
5- '/' ,
6- async ( { body, store, error, request } ) => {
7- return {
8- message : 'Hello World'
9- }
10- }
11- )
3+ import cors from '@elysiajs/cors'
124
135const app = new Elysia ( {
146 adapter : node ( )
157} )
16- . use ( plugin )
8+ . use (
9+ cors ( {
10+ origin : true ,
11+ credentials : true ,
12+ preflight : true
13+ } )
14+ )
15+ . post ( '/' , ( { body } ) => body )
1716 . listen ( 8000 , ( { port } ) => {
1817 console . log ( `Server is running on http://localhost:${ port } ` )
18+
19+ fetch ( 'http://localhost:8000' , {
20+ headers : {
21+ authorization : `Bearer 12345`
22+ }
23+ } )
1924 } )
2025
2126// console.log(app._handle.toString())
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ export const nodeRequestToWebstand = (
6363 return _signal
6464 } ,
6565 // @ts -expect-error
66- duplex : 'content-type' in req . headers ? 'half' : undefined
66+ // ? https://github.com/nodejs/node/issues/46221#issuecomment-1426707013
67+ duplex : 'content-length' in req . headers ? true : undefined
6768 } )
6869}
6970
You can’t perform that action at this time.
0 commit comments