Fix for Markdown rendering for SSR

There’s a problem with ngx-markdown package – it doesn’t work out of the box with server side rendering, because the loader uses HttpClient to load the markdown from a file, but on the server side the relative path makes no sense (as there’s no base URL), so it actually fails to render on the server. Here’s the fix: https://github.com/laas-sh/laas-sh-app/pull/6/files

We provide a custom loader on the server side in app.server.module.ts:

This loader just reads the file with readFileSync on the server. Problem solved!

Cheers,
Andrew

Published by Andrew Leschinsky

Founder and tech lead. https://twitter.com/ALeschinsky