Skip to content

createRouter

function createRouter()

Create and return back a new express router to allow your extension to respond to any requests it may need to respond to, expose the routes of used libraries, etc.

Example:

// Simple router test.
const router = omphalos.createRouter();
router.get('/my_custom_route', (req, res) => res.send('it worked!'))
omphalos.mount(router);