Skip to main content

createRouter

function createRouter()
Server only

This item is only present in the API object given to an extension; it is not available in panels and graphics.

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);