Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client references to server #2

Open
tjesser-ucdavis-edu opened this issue Feb 1, 2019 · 2 comments
Open

Client references to server #2

tjesser-ucdavis-edu opened this issue Feb 1, 2019 · 2 comments

Comments

@tjesser-ucdavis-edu
Copy link
Contributor

Hi, I've been trying to get the seismogram-app working in a set of containers, and been having trouble finding all the places the client refers to the location of the server as localhost.

You can find my attempt here: https://github.com/tjesser-ucdavis-edu/docker-SKATE.

I'm using a Docker network to connect containers I created for the database, server, and client, and I've created patches to point the server to the database, but finding where the client refers to the server has been more difficult. Would you be able to point me to where in the code I can make that type of change?

For reference, the error(s) I get:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3000/query/stations. (Reason: CORS request did not succeed).

and I want to be able to tell the client to use the URL http://seismo-server-inst:3000/query/stations.

@mariusnita
Copy link
Collaborator

I think the server urls are contained here: https://github.com/retrievertech/seismogram-app/blob/master/client/src/browse/ServerUrls.svc.js

Basically if you access the website at https://foo.com, it'll connect to the server using https://foo.com:3000. It dynamically grabs the foo.com from the URL.

@mariusnita
Copy link
Collaborator

It would be nice to have a config file for this. Something like:

{
  "database": { "url": "...", "username": "...", "password": "...", "dbname": "..." },
  "skateServer": { "url": "...", "username": "...", "password": "..." }
}

Basically a central config that (a) services can use to instantiate/configure themselves, and (b) service A knows where to find service B.

From this you could auto-generate a server-url.js with contents

export let serverUrl = "<the_url>";

that ServerUrls.svc.js can import and use. This could be null by default and ServerUrls.svc.js can default to using $location if that's the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants