Created
June 1, 2021 00:17
-
-
Save YannMjl/9f52ab919c4805db3a1d8ccda416ff8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ******************************************************************* | |
// "Routes" to forward the supported requests (and any information | |
// encoded in request URLs) to the appropriate controller functions. | |
// ******************************************************************* | |
// import my GET API from the controller functions | |
import { home, getTodayDate, getMonthsName,getIPeople } from '../controller/controller.js'; | |
// set up the routing | |
const routes = (app) => { | |
// home page | |
app.route('/') | |
.get(home) | |
// GET home page. | |
app.route('/home') | |
.get(home) | |
// Get today's date | |
app.route('/today') | |
.get(getTodayDate) | |
// get list of month names | |
app.route('/months') | |
.get(getMonthsName) | |
// get list of People | |
app.route('/people') | |
.get(getItotDevs) | |
} | |
// export the route | |
export default routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment