aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/reporter-server/main.go
blob: 23197cff3e0367f03fd30ad742991142c78f2fa8 (plain)
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
// Copyright 2025 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package main

import (
	"context"
	"log"
	"net/http"

	"github.com/google/syzkaller/syz-cluster/pkg/app"
	"github.com/google/syzkaller/syz-cluster/pkg/reporter"
)

func main() {
	ctx := context.Background()
	env, err := app.Environment(ctx)
	if err != nil {
		app.Fatalf("failed to set up environment: %v", err)
	}

	generator := reporter.NewGenerator(env)
	go generator.Loop(ctx)

	api := reporter.NewAPIServer(env)
	log.Printf("listening on port 8080")
	app.Fatalf("listen failed: %v", http.ListenAndServe(":8080", api.Mux()))
}