WIP
This commit is contained in:
24
cmd/cmd.go
24
cmd/cmd.go
@@ -1,12 +1,13 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"reichard.io/imagini/routes"
|
||||
// "reichard.io/imagini/routes"
|
||||
"reichard.io/imagini/internal/db"
|
||||
"reichard.io/imagini/internal/config"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"net/http"
|
||||
"log"
|
||||
// "net/http"
|
||||
// "log"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -25,12 +26,21 @@ var CmdDBTest = cli.Command{
|
||||
}
|
||||
|
||||
func serveWeb(ctx *cli.Context) error {
|
||||
routes.RegisterRoutes()
|
||||
c := config.NewConfig()
|
||||
db.ConnectDB(c)
|
||||
//db.PopulateTestData()
|
||||
newItems := db.ItemsFromAlbum(1, 2)
|
||||
|
||||
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("%+v\n", newItems)
|
||||
return nil
|
||||
|
||||
|
||||
// routes.RegisterRoutes()
|
||||
|
||||
// if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// return nil
|
||||
}
|
||||
|
||||
func testDatabase(ctx *cli.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user