-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.go
More file actions
36 lines (27 loc) · 741 Bytes
/
main.go
File metadata and controls
36 lines (27 loc) · 741 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
//go:generate npx @tailwindcss/cli -i ./static/css/input.css -o ./static/css/style.css --minify
//go:generate templ generate
package main
import (
"context"
"embed"
"log/slog"
"os"
"os/signal"
"github.com/joho/godotenv"
"github.com/dreamsofcode-io/zenbin/internal/app"
)
//go:embed static
var files embed.FS
func main() {
godotenv.Load()
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
app, err := app.New(logger, app.Config{}, files)
if err != nil {
logger.Error("failed to create app", slog.Any("error", err))
}
if err := app.Start(ctx); err != nil {
logger.Error("failed to start app", slog.Any("error", err))
}
}