3. Routing
End goal structure
Create Snippets router
// Contents of api/snippets.js
import express from "express";
const router = express.Router();
// GET /api/snippets
router.get("/", async (request, response) => {
// TODO
console.log("Hello from Snippets");
});
// TODO: GET /api/snippets/:id
export default router;Add the router to the main server
Test the app
End file structure
Last updated