* feat(api): assist peerJS server * feat(api): install assist_server dependencies and start it with the API * feat(api): assist: list live sessions * feat(nginx): expose assist_server and block peers listing * feat(api): merged sourcemaps reader and assist-server feat(api): change image definition feat(api): changed service start command feat(utilities): created full server & image definition feat(nginx): reset chalice configuration * feat(utilities): utilities.yaml * feat(nginx): utilities URL * feat(utilities): utilities template * feat(ci): Adding utilities GH action. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * feat(utilities): build script Co-authored-by: Rajesh Rajendran <rjshrjndrn@gmail.com>
30 lines
No EOL
890 B
JavaScript
30 lines
No EOL
890 B
JavaScript
var express = require('express');
|
|
var handler = require('./sourcemaps-handler');
|
|
var router = express.Router();
|
|
|
|
router.post('/', (req, res) => {
|
|
let data = '';
|
|
req.on('data', chunk => {
|
|
data += chunk;
|
|
});
|
|
req.on('end', function () {
|
|
data = JSON.parse(data);
|
|
console.log("Starting parser for: " + data.key);
|
|
// process.env = {...process.env, ...data.bucket_config};
|
|
handler.sourcemapReader(data)
|
|
.then((results) => {
|
|
res.statusCode = 200;
|
|
res.setHeader('Content-Type', 'application/json');
|
|
res.end(JSON.stringify(results));
|
|
})
|
|
.catch((e) => {
|
|
console.error("Something went wrong");
|
|
console.error(e);
|
|
res.statusCode(500);
|
|
res.end(e);
|
|
});
|
|
})
|
|
|
|
});
|
|
|
|
module.exports = router; |