Basic sqlite Implementation
This commit is contained in:
16
cmd/cmd.go
16
cmd/cmd.go
@@ -2,9 +2,12 @@ package cmd
|
||||
|
||||
import (
|
||||
"reichard.io/imagini/routes"
|
||||
"reichard.io/imagini/db"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"net/http"
|
||||
"log"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var CmdServe = cli.Command{
|
||||
@@ -14,6 +17,13 @@ var CmdServe = cli.Command{
|
||||
Action: serveWeb,
|
||||
}
|
||||
|
||||
var CmdDBTest = cli.Command{
|
||||
Name: "db",
|
||||
Aliases: []string{"d"},
|
||||
Usage: "test db.",
|
||||
Action: testDatabase,
|
||||
}
|
||||
|
||||
func serveWeb(ctx *cli.Context) error {
|
||||
routes.RegisterRoutes()
|
||||
|
||||
@@ -22,3 +32,9 @@ func serveWeb(ctx *cli.Context) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func testDatabase(ctx *cli.Context) error {
|
||||
resp := db.ItemsFromAlbum(1, 3)
|
||||
fmt.Printf("%v", resp)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user