Best Practices for Handling Login and Signup Forms in SvelteKit with External API Integration
I’m developing a SvelteKit application and need to implement login and signup forms that communicate with an external API. I’m looking for best practices on how to structure this functionality, particularly regarding the use of +page.svelte
and +page.server.ts
files.
Script added to `svelte:head` ends up being included twice
In my root +layout.svelte
file I have the following code:
sveltekit api requests parallel processing
//routes/quotes/+page.js export const load = async ({fetch}) => { // First Fetch Request to Quotes let quotes = []; const fetchQuotes = async () => { const resultQuotes = await fetch(‘https://dummyjson.com/quotes?limit=10’); const quotesData = await resultQuotes.json(); const quotes = quotesData.quotes console.log(“Q” + quotes); return quotes; } // Second Fetch Request to Comments let users = […]
SvelteKit: how to refresh state when opening the same route
I have a top menu bar with links to the different pages on my website. When somebody is on one of those pages and makes some state changes (like filling in a form), then I kind of expect the page to reset to its initial state when the user clicks on the same menu link again. But instead nothing really happens, the state doesn’t reset.
SvelteKit dynamic routing always 404 Not Found
I have a SvetleKit project where I want to add dynamic routes. It is my first big project where I use SvelteKit (it’s way better than React ;). Suppose I have a page on which a lot of objects are displayed in an overview and I want to add a detailed view of each individual object. For the summary I created a /src/routes/overview folder with a +page.svelte for the summary of all objects. For the detailed view, I have made a folder with square brackets around an ID and a +page.svelte, i.e. /src/routes/overview/[objectId]/+page.svelte. But no matter what I do, whenever I navigate to a dynamic route, the content of the +page.svelte in the [objectId] folder is not displayed on the page, but 404 NotFound. I didn’t put anything dynamic in the +page.svelte for testing purposes, only static “HTML”.
Doing API calls in a hook after HTTP request has finished in SvelteKit
I have some statistics and notification API requests I’d like to do in my +server.js code.
How to deploy a static sveltekit app on nginx?
trying to figure out how to host the sveltekit frontend app built with static-adapter.
Here’s my svelte config:
how to node path module in sveltekit
in express app, I used to do this
SvelteKit route gives 500 error on reload
I’ve been working on a SvelteKit project for some time now. Always there has been this issue where if I reload a route other than the home page I get a 500 error. I’m new to web development.
Not able to get a value in the alert inside a component -sveltekit
I am working on a webapp in sveltekit and I am not able to get the value in alert (for debugging).
I have a component ModalFlight.svelte. I am not able to get the value of token retrieved in page.sever.ts in it.
The value retrieved is a token from a third party api which i want to be available to other components as well.
I don’t want to use cookies here because I want to increase my understanding as to where I am going wrong
ModalFlight.svelte