20 lines
333 B
Go
20 lines
333 B
Go
package main
|
|
|
|
import (
|
|
"Hyst2API/app"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func main() {
|
|
r := chi.NewRouter()
|
|
r.Post("/nodes", app.AddNode)
|
|
r.Get("/nodes", app.GetNodes)
|
|
r.Get("/nodes/{id}", app.GetNodeById)
|
|
r.Post("/users", app.AddUser)
|
|
r.Get("/sub/{id}", app.Sub)
|
|
log.Fatal(http.ListenAndServe(":9997", r))
|
|
}
|