This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/cmd/cmd.go

24 lines
413 B
Go
Raw Normal View History

2021-01-03 03:21:11 +00:00
package cmd
import (
"github.com/urfave/cli"
2021-01-03 15:27:22 +00:00
"github.com/go-macaron/gzip"
"gopkg.in/macaron.v1"
2021-01-03 03:21:11 +00:00
)
var CmdServe = cli.Command{
Name: "serve",
Usage: "Start Imagini web server.",
Action: serveWeb,
}
func serveWeb(ctx *cli.Context) error {
2021-01-03 15:27:22 +00:00
m := macaron.Classic()
m.Get("/", func() string {
return "Hello world!"
})
m.Use(gzip.Gziper())
m.Run()
2021-01-03 03:21:11 +00:00
return nil
}