f-21: add first api file
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
ca8f86a07f
commit
9ad407755b
5 changed files with 104 additions and 0 deletions
16
internal/api/agent/server.go
Normal file
16
internal/api/agent/server.go
Normal 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))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue