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

API requests don't work #38

Open
iyakhiev opened this issue Feb 26, 2019 · 3 comments
Open

API requests don't work #38

iyakhiev opened this issue Feb 26, 2019 · 3 comments

Comments

@iyakhiev
Copy link

API requests don't work for me.

GET /dashboard starts working after the fix in routes/api.js
app.get('/api/dashboards', dashboards.get);

I've added '/api' on the start.
It seems to me others will start working after the same fix.

I've used the quickstart guide, but apparently something went wrong.

@baumandm
Copy link
Collaborator

Hi @iyakhiev, this sounds like some kind of configuration mismatch. By default, cyclotron-svc listens for /dashboards etc without an /api prefix and this shouldn't need to change.

The cyclotron-site config configService.js should have a line like this:

restServiceUrl: 'http://localhost:8077',

You don't need to add /api there unless you're handling it via a proxy or something.

If you setup Nginx or another server to reverse proxy /api/* URLs to cyclotron-svc, you will need to strip off the prefix with a rewrite rule. There's an example in the nginx.conf file in the repo:

location ~* ^/api/(.*)$ {
    rewrite ^/api/(.*)$ /$1 break;
    proxy_pass http://localhost:8077;

If I misunderstood what the issue is, please let me know. Or, if there's some documentation that's out of date or misleading, let me know and I'll make sure it gets updated.

@iyakhiev
Copy link
Author

iyakhiev commented Mar 1, 2019

Hello, @baumandm.

Request doesn't work even from Cyclotron API page.
I'am using nodejs server and there are no any proxies and things like this.
I installed it to try on my home PC using installation instructions.

image

@baumandm
Copy link
Collaborator

baumandm commented Apr 9, 2019

@iyakhiev, there's no /api/ path in the URL. Does it work if you try http://localhost:8077/dashboards?

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