small bug fixes and organization

This commit is contained in:
Zoe
2024-12-09 06:03:45 -06:00
parent 54fbb02ad8
commit 6c035fc391
12 changed files with 289 additions and 289 deletions

24
cmd/fluxd/main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"log"
"net/http"
_ "net/http/pprof"
"github.com/juls0730/flux/server"
)
func main() {
fluxServer := server.NewServer()
http.HandleFunc("POST /deploy", fluxServer.DeployHandler)
http.HandleFunc("DELETE /deployments", fluxServer.DeleteAllDeploymentsHandler)
http.HandleFunc("DELETE /deployments/{name}", fluxServer.DeleteDeployHandler)
http.HandleFunc("POST /start/{name}", fluxServer.StartDeployHandler)
http.HandleFunc("POST /stop/{name}", fluxServer.StopDeployHandler)
http.HandleFunc("GET /apps", fluxServer.ListAppsHandler)
http.HandleFunc("GET /heartbeat", fluxServer.DaemonInfoHandler)
log.Printf("Fluxd started on http://127.0.0.1:5647\n")
log.Fatal(http.ListenAndServe(":5647", nil))
}