'How to use an external backend with SvelteKit

I want to use SvelteKit with an external backend. Let's consider the backend is not in NodeJS, already done and running and that every bit of non-static data comes from it.

The goal is to use SSR and other great SvelteKit's features, while being able to handle authenticated cookies, xsrf tokens and more on the backend.

I feel the way to go is by using an adapter that uses the external backend for SSR and forwards all requests. I could not find such adapter already available neither officially or made by the community.

What is the easiest way to do the above ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source