deep-foundation / deep-foundation/deepcase-app

Connector does not allow to connect to remote Deep instance on button click

Open
#224 1 comment 2 reactions 1 assignee Claimed by @Menzorg View on GitHub
bug sweep
Dominant language
TypeScript
Stars
10
Forks
6
PR merge metrics
No merged PRs in 30d

Description

![Screenshot_20230928_174329](https://github.com/deep-foundation/deepcase-app/assets/1431904/441a2cc2-d7f8-4d9d-a952-0013cb2b773f)

# Access to XMLHttpRequest at 'https://deep.deep.foundation/api/gql' from origin 'https://3007-deepfoundation-dev-506i7dtb1c7.ws-eu105.gitpod.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

```
Access to XMLHttpRequest at 'https://deep.deep.foundation/api/gql' from origin 'https://3007-deepfoundation-dev-506i7dtb1c7.ws-eu105.gitpod.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
connector.js:438 URL error {"error":{"message":"Network Error","name":"AxiosError","stack":"AxiosError: Network Error\n at XMLHttpRequest.handleError (webpack-internal:///../deepcase/node_modules/axios/lib/adapters/xhr.js:172:14)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":"xhr","transformRequest":[null],"transformResponse":[null],"timeout":7000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*"},"method":"get","url":"https://deep.deep.foundation/api/gql"},"code":"ERR_NETWORK","status":null}}
xhr.js:251 GET https://deep.deep.foundation/api/gql net::ERR_FAILED 200 (OK)
```

URLs tested:
https://deep.deep.foundation/api/gql
https://deeplinks.deep.foundation/gql
https://3006-deepfoundation-dev-506i7dtb1c7.ws-eu105.gitpod.io/gql

Checklist

- [X] `pages/proxy-server.ts` ✅ Commit [`d9810a8`](https://github.com/deep-foundation/deepcase-app/commit/d9810a8cb88e3d81e074520da5981e371d629250)

• Import the necessary modules from 'http' and 'request' packages.
• Create a server using 'http.createServer()' method.
• In the request handler function, forward the request to 'https://deep.deep.foundation/api/gql' using 'request()' function from 'request' package.
• Set the 'Access-Control-Allow-Origin' header in the response to the origin of the web page.
• Listen to a specific port for incoming requests.

- [X] `pages/index.tsx` ✅ Commit [`834f2c6`](https://github.com/deep-foundation/deepcase-app/commit/834f2c66c451c95df877b5b6f3523d79f94a1c35)

• Replace the URL 'https://deep.deep.foundation/api/gql' with the URL of the proxy server.

- [X] `pages/client-handler.tsx` ✅ Commit [`a6fef31`](https://github.com/deep-foundation/deepcase-app/commit/a6fef31ef6acfb89fb85596956fc0feef9505188)

• Replace the URL 'https://deep.deep.foundation/api/gql' with the URL of the proxy server.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.