import { ShoppingApplication } from './application' ; import { ApplicationConfig } from '@loopback/core' ; export { ShoppingApplication , PackageInfo , PackageKey } from './application' ; export * from './application' ; export async function main ( options ? ) { const app = new ShoppingApplication ( options ) ; await app . boot ( ) ; await app . start ( ) ; const url = app . restServer . url ; console . log ( `Server is running at ${ url }` ) ; console . log ( `Try ${ url }/ping` ) ; return app ; } if ( require . main === module ) { const config = { rest : { port : + ( process . env . PORT ?? 3000 ) , protocol : 'http' , key : '' , cert : '' , host : process . env . HOST , ciphers : [ ] , cors : { origin : [ ] , methods : 'GET,HEAD,PUT,PATCH,POST,DELETE' , preflightContinue : false , optionsSuccessStatus : 204 , maxAge : 86400 , credentials : true , } , gracePeriodForClose : 5000 , openApiSpec : { disabled : false , setServersFromRequest : true , } , } , } ; main ( config ) . catch ( err => { console . error ( 'Cannot start the application.' , err ) ; process . exit ( 1 ) ; } ) ; }