forked from projectsyn/lieutenant-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
30 lines (24 loc) · 784 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -package=api -o=pkg/api/openapi.go -generate=types,server,spec openapi.yaml
//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -package=api -o=pkg/api/client.go -generate=client openapi.yaml
package main
import (
"fmt"
"os"
_ "github.com/cosmtrek/air/runner" // used for hot reload
"github.com/projectsyn/lieutenant-api/pkg/service"
)
// Version is the lieutenant-api version (set during build)
var (
Version = "unreleased"
BuildDate = "now"
)
func main() {
e, err := service.NewAPIServer()
if err != nil {
fmt.Fprintf(os.Stderr, err.Error()+"\n")
os.Exit(1)
}
fmt.Println("Version: " + Version)
fmt.Println("Build Date: " + BuildDate)
e.Logger.Fatal(e.Start(":8080"))
}