Skip to content

Commit

Permalink
Merge pull request #8 from Qihoo360/feature/frontend-separate
Browse files Browse the repository at this point in the history
Feature/frontend separate
  • Loading branch information
70data authored Jun 8, 2019
2 parents 0586207 + 3628f5a commit 46a137a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ build-release-image:

build-frontend-image:
@echo "version: $(RELEASE_VERSION)"
docker build --no-cache --build-arg RAVEN_DSN=$(RAVEN_DSN) -t $(REGISTRY_URI)/wayne:$(RELEASE_VERSION) -f frontend.Dockerfile .
docker build --no-cache --build-arg RAVEN_DSN=$(RAVEN_DSN) -t $(REGISTRY_URI)/wayne-frontend:$(RELEASE_VERSION) -f frontend.Dockerfile .

push-image:
docker push $(REGISTRY_URI)/wayne:$(RELEASE_VERSION)
Expand Down
14 changes: 11 additions & 3 deletions src/backend/routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import (
"net/http"
"path"

"github.com/astaxie/beego"
"github.com/astaxie/beego/context"

"github.com/Qihoo360/wayne/src/backend/controllers"
"github.com/Qihoo360/wayne/src/backend/controllers/apikey"
"github.com/Qihoo360/wayne/src/backend/controllers/app"
Expand Down Expand Up @@ -57,6 +54,9 @@ import (
"github.com/Qihoo360/wayne/src/backend/health"
_ "github.com/Qihoo360/wayne/src/backend/plugins"
"github.com/Qihoo360/wayne/src/backend/util/hack"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
"github.com/astaxie/beego/plugins/cors"
)

func init() {
Expand All @@ -65,6 +65,14 @@ func init() {
beego.AppPath = path.Join(path.Dir(beego.AppPath), "src/backend")
}

beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
AllowAllOrigins: true,
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
AllowCredentials: true,
}))

beego.Handler("/ws/pods/exec", kpod.CreateAttachHandler("/ws/pods/exec"), true)

beego.Get("/healthz", func(ctx *context.Context) {
Expand Down

0 comments on commit 46a137a

Please sign in to comment.