/todoApp

A basic todo app with a pure HTML frontend (to understand how pre-React frontend codes were written)

Primary LanguageJavaScript

This is a basic todo app with raw HTML and an Express backend.

  • Raw HTML is used to learn about DOM manipulation to learn about pre-React era!
  • We have removed unnecessary API calls
  • 'todoServerWithFiles.js' uses files for storage
  • Uses MongoDB for storage

Run locally

Deploy on Vercel

  • follow this article
  • we will need to keep the 'index.html' file inside 'public' folder and add the '/' end point serving the 'index.html' file
  • finally, don't forget to keep the DB connection string secret!
  • Store it in an .env file.

screenshot

  • #1 run npm i -g vercel (to install vercel CLI globally)
  • #2 Create an Express project
  • #3 Name the server file 'index.js'
  • #4 Add the start script inside 'package.json'
{
    "scripts": {
        "start": "node index.js"
    },
}
  • #5 Deploy to Vercel by running vercel in the CLI
  • #6 in the root dir, add 'vercel.json'
{
    "version": 2,
    "builds": [
        {
            "src": "./index.js",
            "use": "@vercel/node"
        }
    ],
    "routes": [
        {
            "src": "/(.*)",
            "dest": "/"
        }
    ]
}
  • #7 Run the command vercel again to build and deploy again

  • However, this project is deployed directly from github to Vercel