Skip to content

Instantly share code, notes, and snippets.

@xnimorz
Created October 29, 2019 21:36
Show Gist options
  • Select an option

  • Save xnimorz/2a62834971f8fd7911fd809c2e8bbd38 to your computer and use it in GitHub Desktop.

Select an option

Save xnimorz/2a62834971f8fd7911fd809c2e8bbd38 to your computer and use it in GitHub Desktop.
ssr example
export default (ctx) => {
let url;
try {
const initialState = ctx.request.body.initialState;
url = ctx.request.body.url;
const render = renderAndLogFabric(ctx);
ctx.body = render(getOrCreateStore(initialState));
} catch (error) {
logCtxError(Логируем ошибку);
ctx.throw(INTERNAL_SERVER_ERROR, getStatusText(INTERNAL_SERVER_ERROR, error));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment