Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hotelReservation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN go get gopkg.in/mgo.v2
RUN go get github.com/bradfitz/gomemcache/memcache
RUN go get github.com/google/uuid
RUN go mod init
RUN go get github.com/rs/zerolog@v1.28.0
RUN go mod vendor
# use local modified github.com/hailocab/go-geoindex instead of upstream one
COPY ./vendor/github.com/hailocab/go-geoindex /go/src/github.com/harlow/go-micro-services/vendor/github.com/hailocab/go-geoindex
Expand Down
6 changes: 6 additions & 0 deletions hotelReservation/services/frontend/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"strconv"

"google.golang.org/grpc"
Expand Down Expand Up @@ -154,6 +155,11 @@ func (s *Server) getGprcConn(name string) (*grpc.ClientConn, error) {
func (s *Server) searchHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
ctx := r.Context()
if os.Getenv("SEARCH_BACKEND_VERSION") == "true" {
log.Error().Msg("hotel search failed")
http.Error(w, "internal server error", http.StatusInternalServerError)
return
}

log.Trace().Msg("starts searchHandler")

Expand Down