xxxxxxxxxx
// In src/v1/routes/workoutRoutes.js
const express = require("express");
const router = express.Router();
router.get("/", (req, res) => {
res.send("Get all workouts");
});
router.get("/:workoutId", (req, res) => {
res.send("Get an existing workout");
});
router.post("/", (req, res) => {
res.send("Create a new workout");
});
router.patch("/:workoutId", (req, res) => {
res.send("Update an existing workout");
});
router.delete("/:workoutId", (req, res) => {
res.send("Delete an existing workout");
});
module.exports = router;
xxxxxxxxxx
It looks like you are learning JavaScript for programing purposes yes?
Well even if that is not the case, freeCodeCamp is a perfect online learning
tool to learn essential things at your level and at your own pace.
So, whatever you are here for, freeCodeCamp is a pretty good place to study
things like HTML/CSS, JavaScript, Python, and more.