Skip to content

Commit

Permalink
Added routes.js
Browse files Browse the repository at this point in the history
  • Loading branch information
arvention committed Mar 28, 2020
1 parent eea54d5 commit 2a1519e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions routes/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

// import module `express`
const express = require('express');

// import module `controller` from `../controllers/controller.js`
const controller = require('../controllers/controller.js');

// import module `signupController` from `../controllers/signupController.js`
const signupController = require('../controllers/signupController.js');

// import module `successController` from `../controllers/successController.js`
const successController = require('../controllers/successController.js')

// import module `profileController` from `../controllers/profileController.js`
const profileController = require('../controllers/profileController.js');

const app = express();

// execute function getFavicon()
// defined in object `controller` in `../controllers/controller.js`
// when a client sends an HTTP GET request for `/favicon.ico`
app.get('/favicon.ico', controller.getFavicon);

// execute function getIndex()
// defined in object `controller` in `../controllers/controller.js`
// when a client sends an HTTP GET request for `/`
app.get('/', controller.getIndex);

// execute function getSignUp()
// defined in object `signupController` in `../controllers/signupController.js`
// when a client sends an HTTP GET request for `/signup`
app.get('/signup', signupController.getSignUp);

// execute function postSignUp()
// defined in object `signupController` in `../controllers/signupController.js`
// when a client sends an HTTP POST request for `/signup`
app.post('/signup', signupController.postSignUp);

// execute function getSuccess()
// defined in object `successController` in `../controllers/successController.js`
// when a client sends an HTTP GET request for `/success`
app.get('/success', successController.getSuccess);

// execute function getProfile()
// defined in object `profileController` in `../controllers/profileController.js`
// when a client sends an HTTP GET request for `/profile/:idNum`
// where `idNum` is a parameter
app.get('/profile/:idNum', profileController.getProfile);

// exports the object `app` (defined above)
// when another script exports from this file
module.exports = app;

0 comments on commit 2a1519e

Please sign in to comment.