mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
23 lines
436 B
JavaScript
23 lines
436 B
JavaScript
var express = require('express');
|
|
var app = express();
|
|
|
|
var actions = {
|
|
play(data) {
|
|
// ...
|
|
},
|
|
pause(data) {
|
|
// ...
|
|
}
|
|
}
|
|
|
|
app.get('/perform/:action/:payload', function(req, res) {
|
|
if (actions.hasOwnProperty(req.params.action)) {
|
|
let action = actions[req.params.action];
|
|
if (typeof action === 'function') {
|
|
res.end(action(req.params.payload));
|
|
return;
|
|
}
|
|
}
|
|
res.end("Unsupported action.");
|
|
});
|