Skip to content

Commit

Permalink
feat: add cloudflared flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoppippi committed Sep 3, 2024
1 parent 9d55f0f commit 1650742
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ const argv = cli({
default: "127.0.0.1",
description: "The hostname to run the server on.",
},

cloudflared: {
type: Boolean,
default: true,
description: "Use cloudflared to tunnel the server",
},
},

help: {
Expand Down Expand Up @@ -72,6 +78,7 @@ if (import.meta.main) {

await Promise.all([
Deno.serve({ port: flags.port, hostname: flags.hostname }, app.fetch),
flags.cloudflared &&
startTunnel({ port: flags.port, hostname: flags.hostname })
.then(async (tunnel) => ensure(await tunnel?.getURL(), is.String))
.then((url) =>
Expand Down

0 comments on commit 1650742

Please sign in to comment.