aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-12 12:47:39 +0100
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-12 12:47:39 +0100
commit0831926787f5e5a1943380a56417fd5f2231030e (patch)
tree4eeb05ced7a5d287324fa2e71ecabe939c0f768d /main.go
parent580e6500a5ebdb5f9970b69c5c3902e4b49c099a (diff)
feat(cli): dev mode listening on port 8000
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.go b/main.go
index fc6d2e4..4bed86c 100644
--- a/main.go
+++ b/main.go
@@ -16,11 +16,13 @@ var templates embed.FS
var (
domain string
configPath string
+ dev bool
)
func init() {
flag.StringVar(&domain, "domain", "", "domain to use")
flag.StringVar(&configPath, "config", "", "config to use")
+ flag.BoolVar(&dev, "dev", false, "dev mode enabled")
}
func main() {
@@ -63,5 +65,9 @@ func main() {
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
}
- g.StartServer(":8000")
+ if dev {
+ g.StartServer(":8000")
+ } else {
+ g.StartServer(":80")
+ }
}