Skip to content

Commit

Permalink
return the responses
Browse files Browse the repository at this point in the history
Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
  • Loading branch information
viveksahu26 committed Sep 14, 2022
1 parent fea0bd5 commit ba62554
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func handleShortUrl(writer http.ResponseWriter, req *http.Request) {
if err != nil {
writer.Write([]byte("Failed to generate response"))
}

writer.Header().Set("Content-Type", "application/json")
writer.WriteHeader(http.StatusOK)
writer.Write(jsonBytes)
}

func main() {
Expand Down

0 comments on commit ba62554

Please sign in to comment.