chore(nginx): create api specific route

This commit is contained in:
Leandro Antônio Farias Machado 2023-06-08 01:21:07 -03:00
parent 0b7390edc1
commit 5a65fd9dff

View File

@ -38,10 +38,10 @@ func NewApi(port string, db db.Database, b mtp.Broker, msgQueue map[string](chan
func StartApi(a Api) {
r := mux.NewRouter()
authentication := r.PathPrefix("/auth").Subrouter()
authentication := r.PathPrefix("/api/auth").Subrouter()
authentication.HandleFunc("/login", a.generateToken).Methods("PUT")
//authentication.HandleFunc("/register", a.registerUser).Methods("POST")
iot := r.PathPrefix("/device").Subrouter()
iot := r.PathPrefix("/api/device").Subrouter()
iot.HandleFunc("", a.retrieveDevices).Methods("GET")
iot.HandleFunc("/{sn}/get", a.deviceGetMsg).Methods("PUT")
iot.HandleFunc("/{sn}/add", a.deviceCreateMsg).Methods("PUT")