mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
15 lines
472 B
JavaScript
15 lines
472 B
JavaScript
const express = require("express");
|
|
const todoController = require("../controllers/todos/todoController");
|
|
|
|
const routes = (app) => {
|
|
const router = express.Router();
|
|
|
|
router.post("/todos", todoController.createTodo);
|
|
|
|
router.get("/", todoController.getAllTodos);
|
|
|
|
//it's a prefix before api it is useful when you have many modules and you want to
|
|
//differentiate b/w each module you can use this technique
|
|
app.use("/api", router);
|
|
};
|
|
module.exports = routes;
|