Created
October 10, 2019 07:18
-
-
Save Sarfarazsajjad/dfe0ae1b9b5d846a7c8c852f09575839 to your computer and use it in GitHub Desktop.
Loobback 3 custom routes
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
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can place this file in your loopback 3 boot folder to run this route