Created
July 10, 2017 20:54
-
-
Save blehr/8db8adc845ffb61ea9e948f2325f1e29 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
const { checkToken } = require("../services/token-validator"); | |
// create the router | |
const apiRouter = express.Router(); | |
// tell the router to use checkToken function | |
apiRouter.use(checkToken); | |
// create routes | |
const routes = () => { | |
apiRouter.route("/user").get(ApiController.getUser); | |
... | |
return apiRouter; | |
}; | |
module.exports = routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment