Skip to content

Commit

Permalink
feat: add --port option
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jul 19, 2024
1 parent 49db30b commit 7440e3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,20 @@ export default async function() {
.command('serve [environment]')
.option('-b, --bin [bin]', 'path to the maizzle executable')
.option('-c, --config [config]', 'path to a maizzle config file')
.option('-nc, --noclear [noclear]', 'do not clear the console log')
.option('-p, --port [port]', 'port number to run the server on')
.description('Start a local development server')
.action(async (env, options) => {
let config = options.config
let port = options.port

if (options.bin) {
let { serve } = await importFrom(options.bin, '@maizzle/framework')

options.config ? await serve(options.config) : await serve({ env })
config ? await serve(config) : await serve({ server: { port }, env })
} else {
let { serve } = await importFrom(process.cwd(), '@maizzle/framework')

options.config ? await serve(options.config) : await serve({ env })
config ? await serve(config) : await serve({ server: { port }, env })
}
})

Expand Down

0 comments on commit 7440e3a

Please sign in to comment.