mirror of
https://github.com/XShengTech/MEGREZ.git
synced 2026-05-03 13:02:38 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f55ecb649 |
@@ -0,0 +1,12 @@
|
||||
package index
|
||||
|
||||
import "github.com/kataras/iris/v12"
|
||||
|
||||
func cors(ctx iris.Context) {
|
||||
ctx.Header("Access-Control-Allow-Origin", "*")
|
||||
ctx.Header("Access-Control-Allow-Methods", "GET")
|
||||
ctx.Header("Access-Control-Allow-Headers", "Content-Type, Authorization")
|
||||
ctx.Header("Access-Control-Max-Age", "86400")
|
||||
ctx.Header("Access-Control-Allow-Credentials", "true")
|
||||
ctx.Next()
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
)
|
||||
|
||||
func InitIndex(app *iris.Application) {
|
||||
app.Use(cors)
|
||||
app.HandleDir("/", GetWebFS(), iris.DirOptions{
|
||||
IndexName: "/index.html",
|
||||
Compress: true,
|
||||
|
||||
Reference in New Issue
Block a user