-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathserver.go
More file actions
41 lines (34 loc) · 738 Bytes
/
server.go
File metadata and controls
41 lines (34 loc) · 738 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"embed"
"os"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/zolamk/trust/cmd"
)
//go:embed migrations/*.sql
var files embed.FS
func main() {
app := &cli.App{
Name: "trust",
Description: "Trust is a user registration and authentication GraphQL API",
Commands: []cli.Command{
{
Name: "run",
Usage: "Start trust server",
Flags: []cli.Flag{
cli.StringFlag{
Name: "config",
Usage: "Configuration file path",
Required: true,
},
},
Action: func(c *cli.Context) {
cmd.Run(c.String("config"), files)
},
},
},
}
logrus.Fatalln(app.Run(os.Args))
}