Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runServer(content) {
const tracer = require('@google-cloud/trace-agent').get();
const server = require('restify').createServer();
server.get('/', (_, res, next) => {
const customSpan = tracer.createChildSpan({ name: 'gen-content' });
res.send(`${JSON.stringify(tracer.getConfig())} ${tracer.getWriterProjectId()} ${content}`)
customSpan.endSpan();
next()
});
server.listen(process.env.PORT || 8080, function () {
console.log('%s listening at %s', server.name, server.url);
});
}