File tree Expand file tree Collapse file tree 3 files changed +28
-20
lines changed
Expand file tree Collapse file tree 3 files changed +28
-20
lines changed Original file line number Diff line number Diff line change 1919 attributes :
2020 label : What version of Elysia is running?
2121 description : Copy the output of `Elysia --revision`
22+ - type : input
23+ attributes :
24+ label : What version of Node Adapter are you using?
25+ description : Copy the output of `Elysia --revision`
2226 - type : input
2327 attributes :
2428 label : What platform is your computer?
Original file line number Diff line number Diff line change 11import { Elysia } from 'elysia'
22import node from '../src'
33
4- export const elysiaApp = new Elysia ( {
5- adapter : node ( )
6- } )
7- // .onError(({ error }) => {
8- // console.log(error)
9- // })
10- . patch ( '/' , ( ) => {
11- const form = new FormData ( )
12- form . append ( 'name' , 'Sancho' )
13- form . append ( 'alias' , 'Don Quixote' )
14-
15- return form
4+ new Elysia ( { adapter : node ( ) } )
5+ . onError ( ( { error } ) => {
6+ return error
167 } )
8+ . derive ( ( { body } ) => {
9+ return {
10+ operation : {
11+ a : 'test' ,
12+ body
13+ }
14+ }
15+ } )
16+ . post ( `/bug` , ( { operation } ) => {
17+ return operation
18+ } )
19+ . listen ( 3777 )
1720
18- export type ElysiaApp = typeof elysiaApp
19-
20- elysiaApp . listen ( 3334 )
21- console . log ( 'Server started at http://localhost:3334' )
22-
23- fetch ( 'http://localhost:3334/' , { method : 'PATCH' } )
24- . then ( ( x ) => x . formData ( ) )
21+ fetch ( 'http://localhost:3777/bug' , {
22+ method : 'POST' ,
23+ headers : {
24+ 'Content-Type' : 'application/json'
25+ } ,
26+ body : JSON . stringify ( { operation : 'test' } )
27+ } )
28+ . then ( ( x ) => x . text ( ) )
2529 . then ( console . log )
Original file line number Diff line number Diff line change 11{
22 "name" : " @elysiajs/node" ,
3- "version" : " 1.2.5 " ,
3+ "version" : " 1.2.6 " ,
44 "description" : " Plugin for Elysia for retreiving Bearer token" ,
55 "license" : " MIT" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments