f-21: add first api file

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-12 17:29:37 +02:00
commit bcedeece18
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
5 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,16 @@
package agentapi
import (
"log"
"net/http"
)
func Start(address string) {
mux := http.NewServeMux()
mux.HandleFunc("/vpcs", VpcsHandler)
mux.HandleFunc("/vpcs/", VpcByNameHandler)
mux.HandleFunc("/subnets", SubnetsHandler)
mux.HandleFunc("/subnets/", SubnetByNameHandler)
log.Printf("API server listening on %s", address)
log.Fatal(http.ListenAndServe(address, mux))
}