For a school project we are creating a Spring Boot application based on Restful. It works flawlessly locally, but once deployed to AWS I receive "net::ERR_CONNECTION_REFUSED" on all GET and POST requests I send to my RestController.
If I just host my database on AWS it works fine locally, but as soon as I upload my project to an AWS instance it goes back to "net::ERR_CONNECTION_REFUSED". I get no exception in Java.
Does anyone have any idea about this? If so, I'd be more than grateful for the help.
I can of course show any code you need to see to clarify anything, I'm just unsure which code would be relevant.
Thanks a lot,
I hope you are all well.
I figured out the issue. I was running both front end and backend in the same project which resulted in API calls from the very same project to ip:8080 was void. I hosted the backend on ip:9090 and the frontend on ip:8080 in order for it to work.
Related
I am working on a project for a client in which I need to load a lot of data into data studio. I am having trouble getting the deployment to work with my REST API.
The API has been tested with code locally but I need to know how to make it compatible with the code base in App Scripts. Has anyone else had experience with working around this? The endpoint is a Python Flask application.
Also, is there a limit on the amount of data that you can dump in a single response to the Data Studio? As a solution to my needs(needing to be able to load data for 300+ accounts) I have created a program that caches the data needed from each account and returns the whole payload at once. There are a lot of entries, so I was wondering if they had a limit to what can be uploaded at once.
Thank you in advance
I found the issue, it was a simple case of forgetting to add the url to the whitelist.
I have a site that is running in Node and using express for the server. I also have an API on a different server I need to hit. Everything works fine except in IE9. The issue is when ever i try to hit my API once i have the page loaded it breaks.
For example on the home page i have a search form where each step makes an API fetch and once I try to make my first fetch i get this error
"Unhanded promise rejectionError: Access Denied"
It seems like it has to do with a CORS issue since IE9 didnt have CORS and the era of the error message. Also when I make the fetched server side I have no issue, its just when the client tries to perform them.
Has anyone had an issue like this and if so how did you fix it?
Currently I am trying this but it hasnt worked yet:
First I changed my api host address to the current sites address with /api at the end.
apiHost: process.env.API_HOST || 'http://127.0.0.1:3000/api'
Then in my express server is run this:
app.use(modRewrite([`^/api/(.*)$ http://api.mysite.dev:8080/$1 [P]`]));
I was hoping to avoid making a fetch cross address with this but no luck as of yet.
Any help would be much appreciated
thanks!
To solve this problem I changed my host file for my machine to use mysite.dev for the 127.0.0.1 IP. Then went to mysite.dev rather than 127.0.0.1 when testing my site. Then did what I did above to get it to work
I have a nifty AngularJS application that uses a JBoss (WildFly 8) RESTful API to retrieve data. To integrate it into my corporate environment, it requires Kerberos authentication. I've see miles of documents and examples, and even some customized advice from an internal Java developer. My problem, at this time, is where in the architecture can/should the Kerberization take place?
Is it upon entry to the AngularJS app? As in do not allow unless the ticket is authorized?
Or do I challenge each API call? If this is the case, then how would I pass along the client Kerberos ticket information to the API call?
If my question sounds disjointed, or naive, it is. This is my first interaction with Kerberos.
Help appreciated, thanks.
I ran into the same problem / challenge with a PHP REST API on an Apache webserver with Kerberos auth.
Since Angular is pure client side every request is made as 'you' in Kerberos terms so you don't have to send the ticket. Your browser already sends the ticket when the request is made.
I created a login (or check logged-in) API endpoint in my PHP API which is called before every locationChange in Angular. If the login action returns false or nothing at all you are redirected to a access_denied.html page residing next to index.html (Angular).
The login action REST endpoint returns some userdata and permissions so you can do authorization.
In my case (also still searching) I also have some authorization on the API level.
Since my implementation involves a corporate webapplication I will add some code examples tomorrow ;)
with a jboss api, it means with java code not with php and httpd in front, you can do it directly in jboss an example :
https://github.com/dstraub/spnego-wildfly
we ar doing exactly this and it works a charm, there is some example with tomcat, jboss and wildfly (different)... tell me if you have any problem... with front Angular JS and API java
I am trying to implement the quickstart application that has been posted here . I am doing everything as it has been instructed. On running the application i get a error of as shown in the screenshot
[01:19:19.661] GET https://accounts.google.com/o/oauth2/auth?client_id=590193668021-m0poda5f50214v9vjvlkqvsg08t0qses.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&immediate=true&proxy=oauth2relay777233220&redirect_uri=postmessage&origin=http%3A%2F%2Flocalhost%3A8000&response_type=token&state=1371767407%7C0.2276743408&authuser=0 [HTTP/1.1 400 Bad Request 384ms]
I am unable to figure out what the problem is.
I am running the internet on a proxy setup in our college. ( Does it have any role in making it not work ?).
Please help. Thanks in advance.
UPDATE
Please run your application directly on a registered domain to test your code. It won't work on localhost straighaway.
For making it work on a localhost, one has to make a subdomain as instructed in the comments.
Thanks.
I'm locally developing an Angularjs app. I'm using the same node web server as in the Angularjs tutorial. The link to the code for the web-server on Github.
The problem is that I can't seem to get html5mode to work on the node server. What I understand so far is that i have to add a base href to my app and rewrite the server code. I tried rewriting the node web server code, but I failed and it didn't work. Could someone please help me in what i should exactly change? Or does someone maybe already has a version of the server rewritten?
The link to my app looks like this: http://localhost:8000/app/index.html
Also refreshing the page on a html5 link doesn't work. Like this: http://localhost:8000/schedule.
Thanks
You have to rewrite incoming requests that aren't to your REST endpoints respond with the same response as the request to /app/index.html.