File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ WORKDIR /go/src
5
5
6
6
RUN go get github.com/bhoriuchi/go-bunyan/bunyan
7
7
RUN go get github.com/gorilla/mux
8
+ RUN go get github.com/gorilla/handlers
8
9
9
10
RUN mkdir -p /go/src/github.com/cjimti/iotwifi
10
11
COPY . /go/src/github.com/cjimti/iotwifi
Original file line number Diff line number Diff line change 1
- IMAGE ?= iotwifi
1
+ IMAGE ?= cjimti/ iotwifi:armhf-1.0.1
2
2
NAME ?= iotwifi
3
3
4
+ all : build push
5
+
4
6
dev : dev_build dev_run
5
7
8
+ build :
9
+ docker build -t $(IMAGE ) .
10
+
11
+ push :
12
+ docker push $(IMAGE )
13
+
6
14
dev_build :
7
15
docker build -t $(IMAGE ) ./dev/
8
16
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ WORKDIR /go/src
13
13
14
14
RUN go get github.com/bhoriuchi/go-bunyan/bunyan
15
15
RUN go get github.com/gorilla/mux
16
+ RUN go get github.com/gorilla/handlers
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"github.com/bhoriuchi/go-bunyan/bunyan"
13
13
"github.com/cjimti/iotwifi/iotwifi"
14
14
"github.com/gorilla/mux"
15
+ "github.com/gorilla/handlers"
15
16
)
16
17
17
18
type ApiReturn struct {
@@ -201,6 +202,7 @@ func main() {
201
202
r := mux .NewRouter ()
202
203
r .Use (allowHeaders )
203
204
r .Use (logHandler )
205
+
204
206
205
207
// set app routes
206
208
r .HandleFunc ("/status" , statusHandler )
@@ -211,7 +213,7 @@ func main() {
211
213
212
214
// serve http
213
215
blog .Info ("HTTP Listening on " + port )
214
- http .ListenAndServe (":" + port , nil )
216
+ http .ListenAndServe (":" + port , handlers . CORS ()( r ) )
215
217
216
218
}
217
219
You can’t perform that action at this time.
0 commit comments