You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
617 B
27 lines
617 B
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator/config"
|
|
"git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator/web"
|
|
"github.com/jinzhu/configor"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var CmdWeb = cli.Command{
|
|
Name: "web",
|
|
Usage: "Starts the web interface",
|
|
Action: runWeb,
|
|
}
|
|
|
|
func runWeb(_ *cli.Context) error {
|
|
if err := configor.New(&configor.Config{ErrorOnUnmatchedKeys: true}).Load(&config.Config, "config.yml"); err != nil {
|
|
return err
|
|
}
|
|
r := web.InitRoutes()
|
|
|
|
fmt.Println("Server is running...")
|
|
return http.ListenAndServe("0.0.0.0:4000", r)
|
|
}
|
|
|