31 lines
481 B
Go
31 lines
481 B
Go
package cmd
|
|
|
|
import (
|
|
"log"
|
|
|
|
api "github.com/ESilva15/PTInvCertSWDB/api"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func restServer(cmd *cobra.Command, args []string) {
|
|
// TODO - We need to load the data somehow to return it
|
|
|
|
err := api.RunServer()
|
|
if err != nil {
|
|
log.Fatal("Failed to run HTTP server:", err)
|
|
}
|
|
}
|
|
|
|
// shelf
|
|
var restServerCMD = &cobra.Command{
|
|
Use: "http",
|
|
Short: "",
|
|
Long: ``,
|
|
Args: nil,
|
|
Run: restServer,
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(restServerCMD)
|
|
}
|