Add initial code

This commit is contained in:
Jacob Gunther
2022-03-08 21:28:46 -06:00
commit b0518288da
33 changed files with 2175 additions and 0 deletions

26
src/routes/uuid.go Normal file
View File

@@ -0,0 +1,26 @@
package routes
import (
"log"
"main/src/util"
"net/http"
"github.com/valyala/fasthttp"
)
func UUIDHandler(ctx *fasthttp.RequestCtx) {
user := ctx.UserValue("user").(string)
uuid, err := util.GetUUID(r, user)
if err != nil {
log.Println(err)
ctx.SetStatusCode(http.StatusInternalServerError)
ctx.SetBodyString(http.StatusText(http.StatusInternalServerError))
return
}
ctx.SetBodyString(uuid)
}