How to run Blockchain explorer for local node?


#1

When I run the Blockchain Explorer locally via npm run serve against local node started via forgae, I have CORS related errors in a browser. Is there something to be configured to let the Blockchain Explorer to work?

  1. forgae node
  2. export VUE_APP_NODE_URL='http://localhost:3001/'
  3. npm run serve
  4. Open http://localhost:8080/

38


#2

Hello,
that looks like an error in the response of the node.
The Access-Control-Allow-Origin header is set by the node, and the browser is saying that the value of the header is invalid.

Take a look at the response header fo the http://localhost:3001/api to see what is going on.


#3

Hello @noandrea,

if I call http://localhost:3001/api myself, I see response header has this:

Response
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, POST, OPTIONS
Content-Type: application/json
Access-Control-Expose-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
Connection: keep-alive
Date: Wed, 13 Mar 2019 08:07:51 GMT
Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range
Content-Length: 126942
Access-Control-Allow-Origin: *
Server: nginx/1.13.8

is there some issue with that?


#4

I am not sure in this case. I can see that you are proxying the node with an nginx server, maybe that is adding some noise to the problem.

In general that error means that in the preflight request (OPTION) the response contains two times the
Access-Control-Allow-Origin header or that header has multiple values


#5

I am using forgae node as Aeternity node. In order to reproduce that just point the Block Explorer to http://localhost:3001. Eventually Block Explorer can’t connect to the Node.