wip: add api auth and /resume endpoint

This commit is contained in:
cătălin 2023-12-04 22:21:34 +01:00
commit 2c6d063717
Signed by: catalin
GPG key ID: 0178DF42F43E5FD2
28 changed files with 2486 additions and 271 deletions

View file

@ -0,0 +1,20 @@
package http
import (
"net/http"
"github.com/gin-gonic/gin"
)
func corsMiddleware(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "*")
c.Header("Access-Control-Allow-Headers", "*")
c.Header("Content-Type", "application/json")
if c.Request.Method != "OPTIONS" {
c.Next()
} else {
c.AbortWithStatus(http.StatusOK)
}
}