tillyninjaspace / sailor_moon

See the front-end deployed link of my React App via AWS Amplify: https://master.d27cizkq724af1.amplifyapp.com
0 stars 0 forks source link

Deploy: Heroku #9

Open tillyninjaspace opened 3 years ago

tillyninjaspace commented 3 years ago

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.

tillyninjaspace commented 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());