Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
]);
const response = stream(
{app}
,
);
ctx.set(Header.ContentType, 'text/html');
ctx.body = response;
} catch (error) {
const errorMessage = `React server-side rendering error:\n${error.stack ||
error.message}`;
logger.log(errorMessage);
ctx.status = StatusCode.InternalServerError;
// eslint-disable-next-line no-process-env
if (process.env.NODE_ENV === 'development') {
ctx.body = errorMessage;
} else {
ctx.throw(StatusCode.InternalServerError, error);
}
}
}
);
ctx.set(Header.ContentType, 'text/html');
ctx.body = response;
} catch (error) {
const errorMessage = `React server-side rendering error:\n${error.stack ||
error.message}`;
logger.log(errorMessage);
ctx.status = StatusCode.InternalServerError;
// eslint-disable-next-line no-process-env
if (process.env.NODE_ENV === 'development') {
ctx.body = errorMessage;
} else {
ctx.throw(StatusCode.InternalServerError, error);
}
}
}