Skip to content
Snippets Groups Projects
Commit 4725158d authored by meskio's avatar meskio :tent:
Browse files

Get a token to input data

parent 9d16e267
No related branches found
No related tags found
No related merge requests found
package api
import (
"log"
"github.com/gorilla/mux"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
......@@ -29,6 +31,10 @@ func Init(dbPath string, signKey string, r *mux.Router) error {
}
a := api{db, []byte(signKey)}
token, err := a.newToken(0, "admin")
log.Print(token)
r.HandleFunc("/signin", a.SignIn).Methods("POST")
r.HandleFunc("/member", a.auth(a.ListMembers)).Methods("GET")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment