26 lines
642 B
Go
26 lines
642 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"go-nkode/core/api"
|
|
"go-nkode/core/nkode"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
db := nkode.NewInMemoryDb()
|
|
nkodeApi := nkode.NewNKodeAPI(&db)
|
|
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))
|
|
}
|