Custom Routes

NodeCG uses express for its routing. Extensions can make their own express apps, and mount them via NodeCG#mount:

// bundles/my-bundle/extension.js
const express = require('express');
const app = express();

module.exports = function (nodecg) {
    app.get('/my-bundle/customroute', (req, res) => {
        res.send('OK!');
    });

    nodecg.mount(app); // The route '/my-bundle/customroute` is now available
};