Before, I was able to resolved my webpack issue thanks to this suggestion. However, when I tried to deploy my react app, I am not getting any errors, but got a "Cannot GET /" when I browse to my deployed link. I tried changing the script
and even moving my entire project to a public
folder. Nothing seems to work for me. What step am I missing in this process?
Here is the directory of my project look like:
|-node_modules
|-public
|-app
|-src
|-webpack.config.js
|-package.json
|-Procfile
|-server.js
The app
folder contains my html, css and main.js files. The src
folder contains my components. Here is my current package.json file:
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"serve": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "5.8.*",
"babel-loader": "5.3.*",
"express": "^4.14.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"webpack": "^1.14.0",
"webpack-dev-server": "^2.3.0"
}
}
This is my server.js:
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/public'));
app.listen(process.env.PORT || 8080);
I appreciate the help. Thank you.