File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ server.get('/', ({ response }) => {
58
58
.send ({ hello: ' world!' , param: ctx .data .param })
59
59
})
60
60
61
- server .listen (1335 , () => console . log ( ' Server running! ' ) )
61
+ server .listen (). then ( address => ` Server running on address ${ address } ` )
62
62
```
63
63
64
64
---
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @secjs/http" ,
3
- "version" : " 1.0.5 " ,
3
+ "version" : " 1.0.6 " ,
4
4
"description" : " " ,
5
5
"license" : " MIT" ,
6
6
"author" : " João Lenon" ,
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ export class Http {
65
65
this . server . addHook ( hookName , FastifyHandler [ handlerType ] ( handler ) )
66
66
}
67
67
68
- listen (
69
- port ?: number ,
70
- cb ?: ( err : Error | null , address : string ) => void ,
71
- ) : void | string {
72
- return this . server . listen ( port || 1335 , cb )
68
+ async listen ( port ?: string | number , host ?: string ) : Promise < string > {
69
+ return this . server . listen ( port || 1335 , host || '127.0.0.1' )
73
70
}
74
71
75
72
close ( cb ?: ( ) => void ) : void {
You can’t perform that action at this time.
0 commit comments