Routes page
CREATE A FOLDER CALLED routes IN THE src FOLDER
CREATE A FILE CALLED index.js in the routes folder
THE CODE LOOKS LIKE THIS:
const {Router} = require("express");
const router = Router();
const {testGet} = require("[PATH TO CONTROLLERS FILE HERE]")
router.get("/testGet", testGet);
module.exports = router;
Here we have called the router router
You can call it by any name you choose
We have also created a route to testGet
and imported it. This function doesn't exist
yet, we are going to create it now.
NEXT CREATE THE controllers.js FILE
controllers