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