Initial commit still with some hardcoded things
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user