File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import {
3535
3636// Default server configuration
3737const 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
3939
4040/**
4141 * 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 {
6161 // Apply default options
6262 const serverOptions : ServerOptions = {
6363 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
6565 cors : options . cors !== undefined ? options . cors : true ,
6666 static : options . static || [ ] ,
6767 middlewares : options . middlewares || [ ] ,
Original file line number Diff line number Diff line change @@ -143,9 +143,10 @@ export function createServerBanner(
143143 port : number ,
144144 options : Record < string , any > = { }
145145) : string {
146+ // Create endpoints - keeping it simple regardless of host binding
146147 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` ,
149150 ] ;
150151
151152 const settings = Object . entries ( options ) . map (
You can’t perform that action at this time.
0 commit comments