File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,17 @@ const types = {
1919 undefined : ( ) => 'not found' ,
2020} ;
2121
22- http . createServer ( async ( req , res ) => {
23- const handler = routing [ req . url ] ;
24- if ( ! handler ) {
25- res . end ( 'Handler not found' ) ;
26- return ;
27- }
28- const data = await handler ( req , res ) ;
29- const type = typeof data ;
30- const serializer = types [ type ] ;
31- const result = serializer ( data ) ;
32- res . end ( result ) ;
33- } ) . listen ( port ) ;
22+ http
23+ . createServer ( async ( req , res ) => {
24+ const handler = routing [ req . url ] ;
25+ if ( ! handler ) {
26+ res . end ( 'Handler not found' ) ;
27+ return ;
28+ }
29+ const data = await handler ( req , res ) ;
30+ const type = typeof data ;
31+ const serializer = types [ type ] ;
32+ const result = serializer ( data ) ;
33+ res . end ( result ) ;
34+ } )
35+ . listen ( port ) ;
You can’t perform that action at this time.
0 commit comments