Added start of Muldap web service
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-03-29 18:07:46 -04:00
parent 092c9f3791
commit 8a572e70b1
12 changed files with 227 additions and 2 deletions

33
cmd/web/init.go Normal file
View File

@ -0,0 +1,33 @@
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()
},
}