Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ The following command line options are available for the `start` command:
| Option | Description | Default | Alias |
| -------------- | ----------------------------------------------------------------------------- | ---------- | ----- |
| --port | Port to listen on | 4141 | -p |
| --listen | Interface to bind to (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only) | 0.0.0.0 | -l |
| --verbose | Enable verbose logging | false | -v |
| --account-type | Account type to use (individual, business, enterprise) | individual | -a |
| --manual | Enable manual request approval | false | none |
Expand Down
10 changes: 10 additions & 0 deletions src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { server } from "./server"

interface RunServerOptions {
port: number
listen: string
verbose: boolean
accountType: string
manual: boolean
Expand Down Expand Up @@ -111,6 +112,7 @@ export async function runServer(options: RunServerOptions): Promise<void> {
serve({
fetch: server.fetch as ServerHandler,
port: options.port,
hostname: options.listen,
})
}

Expand All @@ -126,6 +128,13 @@ export const start = defineCommand({
default: "4141",
description: "Port to listen on",
},
listen: {
alias: "l",
type: "string",
default: "0.0.0.0",
description:
"Interface to bind to (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only)",
},
verbose: {
alias: "v",
type: "boolean",
Expand Down Expand Up @@ -182,6 +191,7 @@ export const start = defineCommand({

return runServer({
port: Number.parseInt(args.port, 10),
listen: args.listen,
verbose: args.verbose,
accountType: args["account-type"],
manual: args.manual,
Expand Down