24 lines
467 B
Go
24 lines
467 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"net/http"
|
||
|
|
||
|
"git.deuxfleurs.fr/deuxfleurs/albatros/pkg"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
config := pkg.BuildConfig()
|
||
|
cluster := pkg.NewCluster(&config)
|
||
|
|
||
|
// init webserver
|
||
|
http.Handle("/hook", pkg.HookHandler{&config, &cluster})
|
||
|
http.Handle("/build", pkg.BuildHandler{&config, &cluster})
|
||
|
|
||
|
// launch
|
||
|
log.Println("Albatros listen on :8080")
|
||
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||
|
log.Fatal("Can't start HTTP server")
|
||
|
}
|
||
|
}
|