Fail to load resource: server 503(service unavailable)
First thing, I am not sure whether I had set up the port correctly. My React frontend is running on localhost:3000 while my Express backend is running on localhost:3001
This is my .env file.
enter image description here
This is my server.js.
enter image description here
On the frontend side, whenever doing a HTTP request, I use Axios, the endpoint url is "http://localhost:3001/app/Member", something like that. I already had a MongoDB Atlas connected with the app, it is working perfectly on localhost:3001, but I have problem trying to deploy it to Heroku. Some people said there is connection problem between MongoDB Atlas and Heroku, they suggest using the MongoDB sandbox in Heroku to solve this problem, but I already have the database with all the data that I want to used with the app, is there any way that I can import the data from my database to the MongoDB sandbox?
I tried to use "heroku local" to test whether is working, the app is running on localhost:5000, I can see my signup and login page, but I am not able to signup or login with a user email and password like I did perfectly on development mode localhost:3000.
I deployed it to heroku live, it gave me a server 503 error(service unavailable). I logged out the error.enter image description here
Related
I deployed a nuxt app to heroku and when I am running it locally, the app is working fine. On the other hand in production the login / register is not working it is always says 400 bad request (there is no explaination why it is a bad request) or 401 unauthorized.
When I am running the up locally, I am pointing to the backend api and it is working fine.
But when it is run in heroku, I get the errors (400 and sometimes 401), oddly it's worked like there random times from different devices but when I logged out and retry create a user errors.
I did not change the code.
I am not sure the problem is with my code or heroku or maybe Pythonanywhere which I am using to host my backend.
It is my first time deploy python DRF as backend and nuxt as front.
My backend is in python DRF.
My front-end nuxt repo nuxt repo
My DRF code backend repo.
In the nuxt app you can see register component with function onSubmit which should register the user and then log him in.
And DRF there is an app name users_auth which has the user model as CustomUser and the Todo model.
nuxt.config.js points to the same place locally and in production.
After deploying my mean app to heroku, everything works fine, page is displayed as it should, but when i tried to login as user and checked chrome network tab i realised that the request url is to Request URL: http://localhost:4444/graphql.
please all help / advice will save my day.
Did you write the url request in your code ? If you tried to request the application you deploy on Heroku you should use environnement variable to set the url.
I have this facebook app and I have setup my client id and secret on the code. When I try to access the api I get this error. I have tried everything. The app domain is localhost and the website url is the path that the app is running. Anyone know how to solve the issue?
This is the request:
https://www.facebook.com/v2.8/dialog/oauth?client_id=266389393769834&state=xxxxx&response_type=code&sdk=php-sdk-5.0.0&redirect_uri=http%3A%2F%2F%5B%3A%3A1%5D%2Fdemo%2F%2Fuser_authentication&scope=email
In order to test a localhost FB login setup, you cannot use their "Production" setup, as this points to an existing website, or IP
localhost, 127.0.0.1 or any alias (for example: my.domain or de.mo) you set on your localhost server will not work when the FB settings is pointing at production environment.
You need to set up a test environment using FB "Create New App"
I followed every instructions from this site Google Dev Console site
and my web app was working well in http://localhost. No issues.
Now I deployed the web app in the AWS-EC2 server. I also added the Javascript Origins to show my 'subdomain.domain.com'. Upon hitting the button 'Google Login' from webapp on subdomain.domain.com, the google-authentication is not working ; shows the below error, where XX.YY.ZZ.AA is my AWS EC2 instance IP;
Error: invalid_request
Permission denied to generate login hint for target domain.
Request Details
redirect_uri=storagerelay://http/XX.YY.ZZ.AA?id=auth736964
response_type=permission id_token scope=email profile openid
openid.realm=
client_id=625394219770-q0qilkfl05m2fortt25j2j63e2dn6c1r.apps.googleusercontent.com
ss_domain=http://XX.YY.ZZ.AA fetch_basic_profile=true gsiwebsdk=2
That’s all we know.
I am asking for help on how to resolve this. Is it a EC2 forward issue, because the google error is not showing my subdomain.domain.com instead EC2-ip address. or something else?
I have set up a Parse Server on Heroku, with an MLab MongoDB. Everything works fine, & when I visit https://myapp.herokuapp.com I see "Make sure to star the parse-server repo on GitHub!".
I can successfully perform API functions through my Postman Console, for example logging in via the following REST API call: https://myapp.herokuapp.com/parse/login?username=admin&password=password.
I can also perform other REST API POST, GET, etc. as you would expect.
I'm now trying to use my own domain "api.mydomain.net". In the Heroku App > Settings > Custom Domains, I have set domain to "api.mydomain.net" & "myapp.herokuapp.com" as the DNS target.
I've also added a CNAME record to the DNS pointing "api" to "myapp.herokuapp.com".
When I visit https://api.mydomain.net I see the "Make sure to star the parse-server repo on GitHub!" message confirming that the CNAME record works, however when I go to perform the same REST API Login call https://api.mydomain.net/parse/login?username=admin&password=password I get the response:
Could not get any response.
This seems to be like an error connecting to
https://api.mydomain.net/parse/login?username=admin&password=password.
What am I missing?
You are trying to securely connect to the Parse Server with https. So you have to add a TSL certificate for your Heroku app in the Heroku dashboard.
Open Heroku app in Heroku dashboard
Open Settings tab
In section Domains and certificates click Configure SSL and choose Automatically configure using Automated Certificate Management.
Click Add domain to add the domain from which the request should be forwarded, e.g. api.example.com.
On your domain registrar's website set the CNAME for api.example.com to the domain in the Heroku app settings, e.g. api.example.com.herokudns.com
Wait until the status of the domain in the Heroku dashboard is Done