Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Configuring API host #4

Open
mplatt opened this issue Jan 8, 2015 · 4 comments
Open

Configuring API host #4

mplatt opened this issue Jan 8, 2015 · 4 comments

Comments

@mplatt
Copy link
Contributor

mplatt commented Jan 8, 2015

Hey there!
Just a quick question: Is there a reason to why the API_HOST is hard coded to localhost in /app/scripts/app.js or am I missing something configuration wise? I would like to run ui regression tests on my build machine while running the admin interface on a different machine.

@christian-bromann
Copy link
Contributor

Hi Moritz, the admin interface comes with the API required for syncing images between your tests (WebdriverCSS) and the admin panel. As far as I can see when running grunt serve:dist you start the frontend application on localhost:8080 and the API server on localhost:9000. If you want to run the API on a different port just change the hardcoded configuration. It is just a default config.

@mplatt
Copy link
Contributor Author

mplatt commented Jan 8, 2015

Thanks for the quick reply.
Say the admin panel is deployed on some machine with the hostname foo.org. It is no problem to POST to foo.org:8080/api/repositories/bar from a test suite. Opening foo.org in a browser will however result in the UI being broken since the browser requests localhost:8080/api/repositories no matter how it is configured.

@christian-bromann
Copy link
Contributor

Have you tried to open foo.org:9000. Seems that this is the url to the UI then. (haven't worked on that project for a while now ^^)

@mplatt
Copy link
Contributor Author

mplatt commented Jan 9, 2015

Hi Christian, OK, I see ^^ Thanks again for your quick replies!

Let me ilustrate what I am encountering real quick:

First, I install and serve webdrivercss-adminpanel on foo.org:

ssh [email protected]
git clone [email protected]:webdriverio/webdrivercss-adminpanel.git
cd webdrivercss-adminpanel/
npm install
bower install
grunt serve:dist

Now on my local dev machine I connect to http://foo.org:9000/.
Page load fails with a 404 for http://localhost:9000/api/repositories. Should be http://foo.org:9000/api/repositories

Check pull req #5 for that.

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

No branches or pull requests

2 participants