Skip to content

Instantly share code, notes, and snippets.

@Sarfarazsajjad
Created October 10, 2019 07:18
Show Gist options
  • Save Sarfarazsajjad/dfe0ae1b9b5d846a7c8c852f09575839 to your computer and use it in GitHub Desktop.
Save Sarfarazsajjad/dfe0ae1b9b5d846a7c8c852f09575839 to your computer and use it in GitHub Desktop.
Loobback 3 custom routes
module.exports = function (app) {
// Install a "/ping" route that returns "pong"
app.get('/ping', function (req, res) {
res.send('pong');
});
// Express router middleware
var router = app.loopback.Router();
router.get('/ping_express', function (req, res) {
res.send('pongaroo');
});
app.use(router);
}
@Sarfarazsajjad
Copy link
Author

Sarfarazsajjad commented Oct 10, 2019

you can place this file in your loopback 3 boot folder to run this route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment