Thursday, 11 May 2017

Deploying Node.js app to Heroku

I am trying to deploy an node app to Heroku and I tried using different paths as the starting point of the application in the Procfile configuration without any luck. I was wondering if anyone could help? Please see the details below:

The contents of my index.js file:

import React from 'react';
import { render } from 'react-dom';
import App from './components/App';

render(
  <App />,
  document.getElementById('root')
);

My file structure:

> project
  > dist
    > bundle.js
    > index.html
  > src
    > index.js
    > index.html
  package.json
  Procfile
  webpack.config.js

The contents of my Procfile are:

web: node App.js

And finally the error I am getting when I try to deploy to Heroku:

Error: Cannot find module '/app/App.js'

If anyone could shed a light on this issue it would be really appreciated!



via Ana

No comments:

Post a Comment