diff options
| author | Ryan Mehri <[email protected]> | 2020-05-10 17:37:36 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-10 17:37:36 -0600 |
| commit | d20bfdc3f1a78a10dce2662b41d76eba6fab0aad (patch) | |
| tree | 465b89c4028572ad9a213b746f50823fb28954a8 /backend/api/routes.go | |
| parent | Merge pull request #11 from jackyzha0/pass_and_expiry (diff) | |
| parent | linked backend and frontend (diff) | |
| download | ctrl-v-d20bfdc3f1a78a10dce2662b41d76eba6fab0aad.tar.xz ctrl-v-d20bfdc3f1a78a10dce2662b41d76eba6fab0aad.zip | |
Merge pull request #13 from jackyzha0/link-fe-be
linked backend and frontend
Diffstat (limited to 'backend/api/routes.go')
| -rw-r--r-- | backend/api/routes.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/api/routes.go b/backend/api/routes.go index a65c886..07bea5a 100644 --- a/backend/api/routes.go +++ b/backend/api/routes.go @@ -18,6 +18,10 @@ func healthCheckFunc(w http.ResponseWriter, r *http.Request) { } func insertFunc(w http.ResponseWriter, r *http.Request) { + + // Allow CORS + w.Header().Set("Access-Control-Allow-Origin", "*") + // get content _ = r.ParseMultipartForm(0) expiry := r.FormValue("expiry") @@ -38,6 +42,10 @@ func insertFunc(w http.ResponseWriter, r *http.Request) { } func getHashFunc(w http.ResponseWriter, r *http.Request) { + + // Allow CORS + w.Header().Set("Access-Control-Allow-Origin", "*") + hash := mux.Vars(r)["hash"] paste, err := cache.C.Get(hash) |