Open tillyninjaspace opened 3 years ago
Yesterday, I had issues with my Contact Form not sending successfully from my Heroku link so today, I did a big debugging day and had to add three things:
Server: `server.use('/api', require('./routes'));
//adding because of heroku error const path = require('path'); server.use(express.static(path.join(__dirname, 'build')));
server.use((req, res, next) => { res.sendFile(path.join(__dirname, 'build', 'index.html')) });`
Package json: "proxy": "http://localhost:4000", and importantly: "start": "node index.js",
I also added body-parser to the server: server.use(bodyParser.json());
User Story: As a developer, I would like deploy my dev site and allow users to use it. I need to showcase this on my portfolio list on my portfolio site.
Implementation: Go in terminal and do a
heroku create
command. Then make sure the environmental variables are set as well. Try to utilized everything on the command line to practice versus going on the Heroku site for a change.