Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
title: post.title,
body: post.body,
})
})
} else {
throw new ContentServiceException({
message: `Unable to find post for id[${id}]`,
})
}
},
}
app.use(
serverConfig.path,
bodyParser.raw(),
ThriftServerExpress({
serviceName: 'content-service',
handler: new ContentService.Processor(serviceHandler),
}),
)
app.listen(serverConfig.port, () => {
console.log(`Thrift server listening at http://${serverConfig.hostName}:${serverConfig.port}`)
})
}())
return {
code: {
status: new Int64(0),
},
value: 'test',
}
},
fetchUnion(): ICommonUnion {
return { option1: 'test' }
},
broken(): void {
throw new Error(`Yeah, this didn't work`)
},
}
const app: express.Application = createThriftServer({
path: EXPRESS_CALC_SERVER_CONFIG.path,
thriftOptions: {
serviceName: 'calculator-service',
handler: new Calculator.Processor(serviceHandlers),
},
})
app.get('/control', (req: express.Request, res: express.Response) => {
res.send('PASS')
})
return app
}