-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
29 lines (22 loc) · 686 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
package main
import (
"os"
"github.com/netresearch/ldap-manager/internal"
"github.com/netresearch/ldap-manager/internal/options"
"github.com/netresearch/ldap-manager/internal/web"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
log.Info().Msgf("LDAP Manager %s starting...", internal.FormatVersion())
opts := options.Parse()
log.Logger = log.Logger.Level(opts.LogLevel)
app, err := web.NewApp(opts)
if err != nil {
log.Fatal().Err(err).Msg("could not initialize web app")
}
if err := app.Listen(":3000"); err != nil {
log.Fatal().Err(err).Msg("could not start web server")
}
}