#How to disable SSR

1 messages Β· Page 1 of 1 (latest)

ripe matrix
#

Hello out there! Astro docs are explaining perfectly how to switch on SSR. But is there any way to switch it off easily? πŸ™‚

vital vector
#

Do you want to switch it off per page or remove SSR from the whole project?

ripe matrix
#

Many thanks for your prompt response! I would like to disable completely if possible.

vital vector
#

That is a bit more complicated because it depends on how your website is coded, for example if your using APIs/endpoints in your project you will not be able to when using SSG

#

But if your website is simple you can:

  • Uninstall your SSR adapter and remove from Astro config
  • Remove output option or turn it to static
  • Rewrite dynamic pages to use getStaticPaths()
ripe matrix
#

It’s just an adjusted blog starter template so it is uncomplicated.
Is there a terminal command similarly to installation?

vital vector
#

No there is no CLI for it

ripe matrix
#

The function dies on blog posts only so I could also just deactivate for blog posts.

vital vector
#

What do you mean?

#

Is it a dynamic route that is failing? You have to rewrite it to use getStaticPaths()

ripe matrix
#

The site works fine. But when I click on my blog and then click on a post I am getting an HTTP 500 Error. The site is: thunderous-naiad-a200c4 and then the netlify domain part.

vital vector
#

Did you turn it to SSG or is this still SSR?

ripe matrix
vital vector
#

Not sure why it is happening, do you have a repo or some code I can look at?

ripe matrix
#

This is the repo

#

It is the starter blog template deployed with Netlify and then slightly adjusted.

spark jay
#

What's the reason you were using SSR in the first place?

ripe matrix
#

Well I wanted to use some svelte in some part of the site. That was the reason. However, I think that I can include it seperately on a subdomain as well to avoid any issues with that. πŸ™‚

vital vector
#

You can use Svelte with SSG too, you don't need SSR to use a UI framework like Svelte

ripe matrix
#

Ok, that was not clear to me. So I can just delete the two lines as stated right?

vital vector
#

Yes, and uninstall @astrojs/netlify

ripe matrix
#

Ok, I will try it. And give feedback on that. Many thanks to both of you - you made my day! πŸ‘πŸ» My deployment is not at risk by @unistall/Netlify right?