muldap/cmd/web/init.go
Gregory Ballantine 8a572e70b1
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Added start of Muldap web service
2023-03-29 18:07:46 -04:00

34 lines
639 B
Go

package web
import (
"fmt"
"github.com/flamego/flamego"
"github.com/flamego/template"
"github.com/spf13/cobra"
w "git.metaunix.net/metaunix.net/muldap/lib/web"
)
// define web command
var WebCmd = &cobra.Command{
Use: "web",
Short: "Start the web service.",
Long: `Start the Muldap web service.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Starting the Muldap web server...")
// instantiate Flamego server instance
f := flamego.Classic()
// enable templates
f.Use(template.Templater())
// register routes
w.RegisterRoutes(f)
// start Flamego
f.Run()
},
}