Sveltekit, console throws Error 500 when backend is down or during end of build-time

216 views Asked by At

How to setup a maintenance page with error code 503? The app shows error 500 if the backend is down for maintenance or when the "Using @sveltejs/adapter-node" during build-time (i.e: npm run build/ vite build), is there a specific way to display maintenance page during build-time along with error 503

More information:

  • Using Adapter node
  • Using NGINX
  • Backend NodeJS, CMS : Strapi
  • Tools used - PM2
1

There are 1 answers

1
Nash Anderson On

If your SvelteKit "backend" is down, I assume that means your entire SvelteKit app is down.

You should replace the standard Nginx error page with your own - specifically targeting error 503.

<!-- /usr/share/nginx/html/503.html -->
<h1>Oops! Something went wrong...</h1>
<p>We seem to be having some technical difficulties. Hang tight.</p>

More information: