use flags to switch server method (web or cli)

This commit is contained in:
Ruidy 2022-01-10 14:11:39 -04:00
parent 456e1829ff
commit 054fb7293e
2 changed files with 17 additions and 4 deletions

View file

@ -2,10 +2,16 @@ lint:
golint cmd/...
golint passgen/...
run:
dev:
air
run:
go main.go
run-web:
go main.go --web=t
web:
cd client && npm run start
.PHONY: lint run
.PHONY: lint run dev run-web

11
main.go
View file

@ -1,6 +1,7 @@
package main
import (
"flag"
"log"
"net/http"
@ -9,8 +10,14 @@ import (
)
func main() {
serveWeb()
//cli()
web := flag.Bool("web", false, "")
flag.Parse()
if *web {
serveWeb()
return
}
cli()
}
func cli() {