メインコンテンツまでスキップ

Router

Extension Only

This can only be used in code which runs on the server.

Router

Creates a new express router.

See the express docs for full usage details.

Example

Defining a simple GET route:

module.exports = function(nodecg) {
const app = nodecg.Router();
app.get('/my-bundle/example', (req, res) => {
res.send('custom route confirmed');
});
nodecg.mount(app);
}