ml
This commit is contained in:
1 parent
21f04d696b
commit
8f5c267444
26 files changed
+3039
-10
No files matched your search
+9
-2
@@ -293,6 +293,8 @@ func main() {
|
||||
// Source-map uploads are intentionally public so the release build script
|
||||
// can upload maps without an OIDC session or bearer token.
|
||||
uiMux.HandleFunc("POST /api/sourcemaps", coll.HandleSourceMap)
|
||||
uiMux.HandleFunc("GET /api/needle/status", coll.HandleNeedleStatus)
|
||||
uiMux.HandleFunc("POST /api/needle/classify", coll.HandleNeedleClassify)
|
||||
|
||||
// Protected API & WebSocket routes
|
||||
uiMux.Handle("/api/history", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleHistory)))
|
||||
@@ -303,6 +305,7 @@ func main() {
|
||||
uiMux.Handle("/api/history/wait", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleWait)))
|
||||
uiMux.Handle("GET /api/traces/{traceId}", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleTraceByID)))
|
||||
uiMux.Handle("/api/issues", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleIssues)))
|
||||
uiMux.Handle("POST /api/ml/test-spike", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleMLDetectorTest)))
|
||||
uiMux.Handle("GET /api/issues/{id}", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleIssueByID)))
|
||||
uiMux.Handle("GET /api/issues/{id}/similar", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleIssueSimilar)))
|
||||
uiMux.Handle("POST /api/issues/{id}/similar", oidcAuth.RequireAuth(http.HandlerFunc(coll.HandleSimilarityFeedback)))
|
||||
@@ -357,9 +360,13 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
httpPort := os.Getenv("PORT")
|
||||
if httpPort == "" {
|
||||
httpPort = "8080"
|
||||
}
|
||||
uiHandler := honeypotTracker.Middleware(uiMux)
|
||||
if err := http.ListenAndServe(":8080", uiHandler); err != nil {
|
||||
log.Fatalf("failed to start HTTP server: %v", err)
|
||||
if err := http.ListenAndServe(":"+httpPort, uiHandler); err != nil {
|
||||
log.Fatalf("failed to start HTTP server on :%s: %v", httpPort, err)
|
||||
}
|
||||
}
|
||||
func spaHandler(root http.FileSystem) http.Handler {
|
||||
|
||||
Reference in new issue
Block a user