Reputation: 21
Is there anyway to use svelte and astro for a front-end and then some how bundle that together to be used as Backend? I really like all the benefits of svelte and astro for front end and I am familiar with flask so I feel like this could work really well for me.
Upvotes: 0
Views: 1560
Reputation: 1901
Yes, this is totally possible.
you can run Astro in SSR mode, with any frontend framework e.g. Svelte , and from there in the frontmatter of .astro files call flask API end points (e.g. await fetch) here more details about Astro SSR https://docs.astro.build/en/guides/server-side-rendering/
you can also and at the same time, open Astro API endpoints that can be consumed by flask calls. here more details about Astro endpoints routes https://docs.astro.build/en/core-concepts/endpoints/#server-endpoints-api-routes
Upvotes: 0