cspj-application/server/internal/http_server/http_server.go

20 lines
539 B
Go
Raw Normal View History

2024-11-11 17:34:37 +08:00
package http_server
import (
"log"
"net/http"
"github.com/Vomitblood/cspj-application/server/internal/sql_injection"
)
// setup the http server
func ServeApi() {
http.HandleFunc("/execute-sql", sql_injection.ExecuteSql)
http.HandleFunc("/secure-execute-sql", sql_injection.SecureExecuteSql)
http.HandleFunc("/secure-get-user", sql_injection.SecureExecuteSql)
log.Println("Server is running on http://localhost:3001")
if err := http.ListenAndServe(":3001", nil); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
}