Skip to main content
Module

x/aleph/cli/dev.ts

The Full-stack Framework in Deno.
Very Popular
Go to Latest
File
import { Application, serve } from '../server/mod.ts'import { getOptionValue, parsePortNumber } from '../server/util.ts'
export const helpMessage = `Usage: aleph dev <dir> [...options]
<dir> represents the directory of Aleph.js app,if the <dir> is empty, the current directory will be used.
Options: -p, --port <port> A port number to start the Aleph.js app, default is 8080 -L, --log-level <log-level> Set log level [possible values: debug, info] -r, --reload Reload source code cache -h, --help Prints help message`
export default async function (workingDir: string, options: Record<string, string | boolean>) { const app = new Application(workingDir, 'development', Boolean(options.r || options.reload)) const port = parsePortNumber(getOptionValue(options, ['p', 'port'], '8080')) await serve({ app, port, hostname: 'localhost' })}