implement api

This commit is contained in:
2024-08-21 08:20:51 -05:00
parent 603936b50c
commit 6a56b2300a
18 changed files with 505 additions and 124 deletions

22
main.go
View File

@@ -1,9 +1,23 @@
package main
import "fmt"
import (
"fmt"
"go-nkode/core/api"
"log"
"net/http"
)
func main() {
a := 3
b := a / 2
fmt.Println(b)
nkodeApi := api.NewNKodeAPI()
handler := api.NKodeHandler{Api: nkodeApi}
mux := http.NewServeMux()
mux.Handle(api.CreateNewCustomer, &handler)
mux.Handle(api.GenerateSignupInterface, &handler)
mux.Handle(api.SetNKode, &handler)
mux.Handle(api.ConfirmNKode, &handler)
mux.Handle(api.GetLoginInterface, &handler)
mux.Handle(api.Login, &handler)
mux.Handle(api.RenewAttributes, &handler)
fmt.Println("Running on localhost:8080")
log.Fatal(http.ListenAndServe("localhost:8080", mux))
}