Wow so easy

This commit is contained in:
cdricms
2024-01-16 00:03:38 +01:00
commit c89ee17329
3 changed files with 48 additions and 0 deletions

18
main.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"net/http"
"git.cems.dev/cdricms/go-api/api"
)
func main() {
http.HandleFunc("/user", api.GetUserHandler)
port := 8080
fmt.Printf("Server running on : %d\n", port)
err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
if err != nil {
fmt.Println("Error: ", err)
}
}