mirror of
https://github.com/rjNemo/go-pass-gen
synced 2026-06-06 02:46:40 +00:00
30 lines
356 B
Go
30 lines
356 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/rjNemo/go-pass-gen/api"
|
|
"github.com/rjNemo/go-pass-gen/cmd"
|
|
)
|
|
|
|
func main() {
|
|
web := flag.Bool("web", false, "")
|
|
flag.Parse()
|
|
|
|
if *web {
|
|
serveWeb()
|
|
return
|
|
}
|
|
cli()
|
|
}
|
|
|
|
func cli() {
|
|
cmd.Execute()
|
|
}
|
|
|
|
func serveWeb() {
|
|
s := api.NewServer()
|
|
log.Fatal(http.ListenAndServe(":8080", s))
|
|
}
|