File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import {
35
35
36
36
// Default server configuration
37
37
const DEFAULT_PORT = 3000 ;
38
- const DEFAULT_HOST = 'localhost' ;
38
+ const DEFAULT_HOST = '0.0.0.0' ; // Changed from 'localhost' to '0.0.0.0' to allow external connections
39
39
40
40
/**
41
41
* Parse command line arguments into a structured object
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export function create(options: Partial<ServerOptions> = {}): JsonServer {
61
61
// Apply default options
62
62
const serverOptions : ServerOptions = {
63
63
port : options . port || 3000 ,
64
- host : options . host || 'localhost' ,
64
+ host : options . host || '0.0.0.0' , // Changed from 'localhost' to '0.0.0.0' to allow external connections
65
65
cors : options . cors !== undefined ? options . cors : true ,
66
66
static : options . static || [ ] ,
67
67
middlewares : options . middlewares || [ ] ,
Original file line number Diff line number Diff line change @@ -143,9 +143,10 @@ export function createServerBanner(
143
143
port : number ,
144
144
options : Record < string , any > = { }
145
145
) : string {
146
+ // Create endpoints - keeping it simple regardless of host binding
146
147
const endpoints = [
147
- `${ styles . url ( `http://${ host } :${ port } ` ) } - API Root` ,
148
- `${ styles . url ( `http://${ host } :${ port } /db` ) } - Full Database` ,
148
+ `${ styles . url ( `http://localhost :${ port } ` ) } - API Root` ,
149
+ `${ styles . url ( `http://localhost :${ port } /db` ) } - Full Database` ,
149
150
] ;
150
151
151
152
const settings = Object . entries ( options ) . map (
You can’t perform that action at this time.
0 commit comments