@@ -41,6 +41,12 @@ export class Run extends Command {
4141 options : [ 'info' , 'debug' ] , // default value if flag not passed (can be a function that returns a string or undefined)
4242 required : false , // make flag required (this is not common and you should probably use an argument instead)
4343 } ) ,
44+ apiRoute : flags . string ( {
45+ description : 'path to use for api route' , // help description for flag
46+ hidden : false , // hide from help
47+ default : '/api' ,
48+ required : false , // make flag required (this is not common and you should probably use an argument instead)
49+ } ) ,
4450 } ;
4551
4652 static args = [
@@ -62,6 +68,7 @@ export class Run extends Command {
6268 defaultConfig . readOnly = flags . readonly ;
6369 defaultConfig . enableSwagger = flags . swagger ;
6470 defaultConfig . logLevel = flags . loglevel as LogLevel ;
71+ defaultConfig . apiRoutePath = flags . apiRoute ;
6572 defaultConfig . jsonFile = args . file ;
6673 if ( args . file && flags . env ) {
6774 const promise = startServer (
@@ -91,7 +98,7 @@ export class Run extends Command {
9198 } ,
9299 {
93100 text : `${ chalk . blueBright ( 'API Routes' ) } ` ,
94- link : 'http://localhost:3000/api /{routes}' ,
101+ link : 'http://localhost:3000' + flags . apiRoute + ' /{routes}',
95102 } ,
96103 ] ,
97104 { text : { minWidth : 30 } , link : { minWidth : 20 } } ,
@@ -102,7 +109,7 @@ export class Run extends Command {
102109 [
103110 {
104111 text : `${ chalk . blueBright ( 'API Routes' ) } ` ,
105- link : 'http://localhost:3000/api /{routes}' ,
112+ link : 'http://localhost:3000' + flags . apiRoute + ' /{routes}',
106113 } ,
107114 ] ,
108115 { text : { minWidth : 30 } , link : { minWidth : 20 } } ,
0 commit comments