-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Rails API with Create-React-App on Heroku #1358
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
Comments
I don't know much about Heroku but presumably your server doesn't have Node.js? |
Yes! A example: https://www.fullstackreact.com/articles/how-to-get-create-react-app-to-work-with-your-rails-api/ The structure is pretty much the same. |
I have created a project using create react app and the backend rails api is on different server and i am facing cross origin unable hit any post api from |
@shabanraza While this isn't a Create React App issue, you might want to checkout the rack cors gem. Maybe this can be closed @gaearon ? |
Original post: http://stackoverflow.com/questions/39774143/rails-api-with-create-react-app-on-heroku-npm-command-not-found
I created Rails API backend app and inside the app in a folder client I created create-react-app for my frontend. It works well on my local machine but does not work on heroku with an error:
npm: command not found
This is the structure of the app:
rails-app
Inside Procfile I have:
web: cd client && npm start
api: bundle exec rails s -p 3001
The text was updated successfully, but these errors were encountered: