Yay! We have completed our application and it's ready for the world wide web. We could figure out hosting for ourselves and create a CI/CD pipeline that handles the deployment of our application or we could save a ton of headache and use an awesome new platform for deploying our application and hosting our database on kinsta.
Currently, our application lives inside of a directory called html5up-multiverse. At the time of creating this course, there is no way to specify a deployment path on kinsta which isn't a big deal. We just need to move all the contents of the html5up-multiverse directory into the root of our project.
We need to create a package.json command for production called "start".
In package.json add a new line that should look like this:
"scripts": {
"dev": "nodemon server.js",
"start": "node server.js"
},
Go to github.com and login.
Create a new repository - make sure it's public.
Push your code to the repository.
If you haven't already, head to https://kinsta.com and create an account.
Log into my.kinsta.com.
Go to Applications
Select Application and fill out the form - be sure to select your github repository.
Next we need to add another service except this time it needs to be a database.
Create the database and then select it from your list of applications.
Let's get the database connection details.
There are some details we need to update on our application from this screen:
On server.js, update your sqlPort to match the port number provided.
Inside of /config/config.json, update it to match the hostname, username and password.
Save your changes and commit your code to your repository.
If we go to our photosharing application on the list of applications and open it up. We should see something like this:
Your application is now live!
Please update your resume, you did it!
We covered a lot of material from the basics of NPM and we walked all the way through encrypting our passwords. We learned all about middleware, MariaDB, and Express. We built a beautiful application to show off to our friends. Most importantly, we have added to our resume.
They say journey's are alone and adventures are with friends. We have learned a lot in this course together. I want to personally thank you for taking the time out of your busy life to embark on this adventure with me. Until next time!