Heroku Free Web Hosting + Back-End Tutorial in 12 Minutes |  Node.js + Express | Quick Code

Hosting on Heroku – Heroku Free Web Hosting + Back-End Tutorial in 12 Minutes | Node.js + Express | Quick Code


Heroku Free Web Hosting + Back-End Tutorial in 12 Minutes | Node.js + Express | Quick Code

Hosting on Heroku

Get your dynamic angular website on the web with free hosting from Heroku! Write some back-end code, make a Heroku account, and deploy it all with git in just 12 minutes. Thank you for watching!

Need some new tech gadgets or a new charger? Buy from my Amazon Storefront

Starter Code |

Blog Post |

Download NPM/Node.js |

Download Heroku Command Line Tools | –

Download Git |

Code |

Check out my courses on LinkedIn Learning!
REFERRAL CODE:

Support me on Patreon!

Check out my Python Basics course on Highbrow!

Check out behind-the-scenes on my Instagram!

Free HACKATHON MODE playlist:

MY FAVORITE THINGS:
Stitch Fix Invite Code:
FabFitFun Invite Code:
Uber Invite Code: kathrynh1277ue
Postmates Invite Code: 7373F
SoulCycle Invite Code:
Rent The Runway:

GitHub |

Devpost |

Website |

Twitter |

Facebook |

Pinterest |

LinkedIn |

Want more coding help? Sign up for a one-on-one session with me on codementor |

you search:

Hosting on Heroku

Heroku Free Web Hosting + Back-End Tutorial in 12 Minutes | Node.js + Express | Quick Code

43 thoughts on “Hosting on Heroku – Heroku Free Web Hosting + Back-End Tutorial in 12 Minutes | Node.js + Express | Quick Code

  1. @blondiebytes
    Thanks for the tutorial, it works perfectly.
    however, I was trying to modify the code to suit my purpose of inserting data from an HTML form into my HEROKU PostgreSql database online but it failed. when I execute the code online, I get (internal server error) here is the code I have for that.

    const express = require('express');
    var app = express();

    var pg = require('pg');

    //set port

    var port = process.env.PORT || 8080

    var connection = {connectionString: process.env.DATABASE_URL || "postgres://xxxxxxxxxxxxxx"};

    var client = new pg.Client(connection);

    client.connect();

    app.use(express.static(__dirname ));

    //routes

    app.get('/', function (req, res) {

    res.render("index");

    });

    app.post('/submit', function (req, res) {

    // Grab data from http request

    const data = {firstname: req.body.firstname,

    lastname: req.body.lastname,

    mail: req.body.mail,

    country: req.body.country,

    zipcode: req.body.zipcode,

    cityName: req.body.cityName,

    google: req.body.google,

    twitter: req.body.twitter,

    linkdin: req.body.linkdin,

    facebook: req.body.facebook,

    comm: req.body.comm

    };

    connection.connect(function (err) {

    if (err) throw err;

    console.log("connected");

    var pg = "INSERT INTO userdata(firstname, lastname, mail, country, zipcode, cityname, google, twitter, linkdin, facebook, comm) VALUES ('"+data.firstname+"', '"+data.lastname+"', '"+data.mail+"', '"+data.country+"', '"+data.zipcode+"', "+data.cityName+", '"+data.google+"', '"+data.twitter+"', '"+data.linkdin+"','"+data.facebook+"', '"+data.comm+"')";

    connection.query(pg, function (err, result) {

    if (err) throw err;

    console.log("table created");

    });

    });

    res.sendFile('index.html', { root: __dirname });

    });

    app.listen(port, function(){

    console.log("app running");

    })

  2. I get an error when I try to npm install:

    npm ERR! JSON.parse Failed to parse json
    npm ERR! JSON.parse Unexpected string in JSON at position 173 while parsing '{
    npm ERR! JSON.parse "name" : "tutorial",
    npm ERR! JSON.parse "version" : "1.'
    npm ERR! JSON.parse Failed to parse package.json data.

  3. Hi thanks for your video and it helps me a lot. I have a dought in that, the thing is can I upload Front end in GoDaddy ,and back end in herokup coz I need just a simple contact form in the front end which runs on html css and javascript and in the front end I have a contact form on submitting it should post to my email for this I can use heroku only for backend and GoDaddy for frontend will it work?

  4. honestly, I have search all over the internet to find the answer on how to upload my (app.js website) which was build using localhost server. it took me couple days to understand how to work the terminal window, but pretty much I was stuck on viewing my website on my localhost.the problem know is that I am stuck and I don't know how to deploy it to the internet.

  5. Windows 10 here, I installed heroku, but I went to cmd and ran "heroku –version" and it says that heroku isnt a command. I tried uninstalling and reinstalling. Is there anything to do to fix this? The git install worked fine though…. I am using the appropriate x64 version.
    SOLVED I manually added the heroku path variable to the environment variables or whatever and it works now! P.S great tutorial!

  6. Im totally new to all this stuff and it seemed complicated. I ve spent plenty of time on starting my project on heroku, without you it would take much more time, thanks a lot

  7. i got this
    ERROR: npm is known not to run on Node.js v4.1.2

    remote: Node.js 4 is supported but the specific version you're running has

    remote: a bug known to break npm. Please update to at least 4.7.0 to use this

    remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/

    remote: ERROR: npm is known not to run on Node.js v4.1.2

    remote: Node.js 4 is supported but the specific version you're running has

    remote: a bug known to break npm. Please update to at least 4.7.0 to use this

    remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/

    remote: ERROR: npm is known not to run on Node.js v4.1.2

    remote: Node.js 4 is supported but the specific version you're running has

    remote: a bug known to break npm. Please update to at least 4.7.0 to use this

    remote: version of npm. You can find the latest release of Node.js at https://nodejs.org/

    remote:

    remote: —–> Build failed

  8. Hey Kathryn, I love all of your videos! I'm having trouble with a simple web app that I'm working on as a school project. It is a rostering app where I have a table for the users to enter in their names if they are available, I want the changes made by one user to be visible to all the other users and also once the page is refreshed I don't want the data they've entered to be lost! Can you please help me with this so that I can have my app on Heroku? Waiting for your reply!!!! Thank you soo much!

  9. Great job! I lost whole day to integrating Github repository (Express.js) with TravisCI and Firebase…
    So, I've decided to change hosting to Heroku and thanks to your help I've created simple Express.js application in a few minutes.
    Thanks a lot of : ) I will have a backend repository there in the future 😀
    As you know there is possibility to deploy application without Heroku CLI (GitHub is enough) now, so the process of deploying apps is much quicker…
    PS: I'm afraid you added wrong link to starter code because it redirects to Angular folder instead of Heroku ; )

  10. How can can I upload my Node.js server to the cloud? Reason I ask is for my assignment, I'm creating a desktop application (using Electron) that communicates with the Node.js on my teammate's laptop. However, because the server resides in my teammate's laptop, the IP in my desktop client's source code has to be changed in order to interact with the server; therefore, I want to post the Node.js server on the cloud to remove this tediousness

Leave a Reply

Your email address will not be published. Required fields are marked *