Search code examples
herokudeploymentgithub-pagesnetlify

Deploy front end and backend code on the web


I made an application for an internship. The front end is made using normal html,css,jquery,bootstrap (no framework).The backend is made using node.js and database used in mongodb.

My project structure is

  • Web folder-Contains folders like html,css,js.
  • Api folder-Contains all my backend code.

Now, I want to deploy this app to the web such that it works same way it is working locally. My front end makes ajax request to node.js server currently.

How do I deploy such an app? Also hosting should be free. I know some approaches such as using Netlify or Github Pages on front end and heroku for backend but don't know the detailed approach. Help would be appreciated.


Solution

  • Netlify makes the process easy. If your project is in a Git repo you can configure continuous deployment.

    Each time you push to your Git provider, Netlify runs a build with your tool of choice and deploys the result to our powerful CDN.

    In short...

    1. Log in at https://app.netlify.com
    2. Click New Site from Git.
    3. Select a Git provider.
    4. Select a repo.
    5. Configure your build.

    Here's a 2-minute video walkthrough.