Reorganize & Add DB Bootstrapping
This commit is contained in:
11
cmd/cmd.go
11
cmd/cmd.go
@@ -1,11 +1,12 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"reichard.io/imagini/routes"
|
||||
"reichard.io/imagini/internal/context"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"net/http"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -16,19 +17,11 @@ var CmdServe = cli.Command{
|
||||
Action: serveWeb,
|
||||
}
|
||||
|
||||
// var CmdDBTest = cli.Command{
|
||||
// Name: "test",
|
||||
// Aliases: []string{"t"},
|
||||
// Usage: "test db.",
|
||||
// Action: testDatabase,
|
||||
// }
|
||||
|
||||
func serveWeb(cliCtx *cli.Context) error {
|
||||
log.Info("Serving Web")
|
||||
|
||||
ctx := context.NewImaginiContext()
|
||||
routes.RegisterRoutes(ctx)
|
||||
//listener, _ := net.Listen("tcp", ctx.Config.ListenPort)
|
||||
|
||||
if err := http.ListenAndServe(":" + ctx.Config.ListenPort, nil); err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user