Skip to content

Instantly share code, notes, and snippets.

@blehr
Created July 10, 2017 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blehr/8db8adc845ffb61ea9e948f2325f1e29 to your computer and use it in GitHub Desktop.
Save blehr/8db8adc845ffb61ea9e948f2325f1e29 to your computer and use it in GitHub Desktop.
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