Skip to content

Instantly share code, notes, and snippets.

@catarak
Created April 26, 2017 16:15
Show Gist options
  • Save catarak/6fb1c60352676dcb6140c23666da7c30 to your computer and use it in GitHub Desktop.
Save catarak/6fb1c60352676dcb6140c23666da7c30 to your computer and use it in GitHub Desktop.
// Partial Express.js API for accessing microservices from front end dashboard
// ...
app.get('/api/tmstocsv/info', (req, res) => {
seneca.act('role:tmstocsv,cmd:info').then((info) => {
res.json(info);
});
});
app.get('/api/tmstocsv/run', (req, res) => {
seneca.act('role:tmstocsv,cmd:run').then(() => {
res.json({success: true});
});
});
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment