Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Getting 404 from react and node apps hosted separately
Author Summary
aguilasolige is age 40
Post Body

Hi I'm stuck trying to get my mern app to work on heroku. I am getting 404 errors when I make requests from my frontend to my backend. I am using this to deploy my frontend https://github.com/mars/create-react-app-buildpack

This my static.json file, API_URL is an env variable on heroku.

{
"root": "build/",
"routes": {
"/**": "index.html"
},
"proxies": {
"/api/": {
"origin": "${API_URL}"
}
}
}

my calls look like this: axios.get('/api/spotify/new-releases')

my heroku front end logs:

2019-01-07T17:52:09.099153 00:00 app[web.1]: 10.16.177.123 - - [07/Jan/2019:17:52:09 0000] "GET /api/spotify/new-releases HTTP/1.1" 404 159 "https://albumfied.herokuapp.com/home" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"

and my backend:
2019-01-07T17:52:09.092862 00:00 heroku[router]: at=info method=GET path="/spotify/new-releases" host=albumfied-server.herokuapp.com request_id=be992da8-7bf9-4fe1-986e-a6007581fcd6 fwd="98.242.149.225,54.198.236.35" dyno=web.1 connect=2ms service=6ms status=404 bytes=403 protocol=https

I think the problem is that my frontend and backend urls are not matching, maybe my proxy is not set up properly. I've been trying to fix this for several days now and I haven't been able to. I'd really appreciate any help, thanks.

Author
Account Strength
90%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,425
Link Karma
83
Comment Karma
3,324
Profile updated: 4 days ago
Posts updated: 1 month ago

Subreddit

Post Details

Age
40
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago