Skip to content

Instantly share code, notes, and snippets.

@YannMjl
Created June 1, 2021 00:17
Show Gist options
  • Save YannMjl/9f52ab919c4805db3a1d8ccda416ff8e to your computer and use it in GitHub Desktop.
Save YannMjl/9f52ab919c4805db3a1d8ccda416ff8e to your computer and use it in GitHub Desktop.
// *******************************************************************
// "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