Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async function startContentServer() {
const app: express.Application = express()
const serverConfig = await config().get('content.server')
const clientConfig = await config().get('content.client')
const userClientV1: UserService.Client = createClient(UserService.Client, clientConfig)
const serviceHandler: ContentService.IHandler = {
getPost(id: number, context?: express.Request): Promise {
console.log(`ContentService: getPost[${id}]`)
const post: IMockPost | undefined = findPost(id)
if (post !== undefined) {
return userClientV1.getUser(post.author).then((author: User) => {
return new Post({
id: post.id,
author,
date: new PublishedDate(post.date),
title: post.title,
body: post.body,
})
})
} else {