In SvelteKit, I have an endpoint like this:
export async function GET(event: RequestEvent) {
return json({message: "Hello World!"});
}
Simply removing the exclamation mark
export async function GET(event: RequestEvent) {
return json({message: "Hello World"});
}
causes the browser to refresh which makes no sense. Is there some configuration I can add to stop that from happening?
I tried this:
export default defineConfig({
server: {
watch: {
ignored: ['**/src/routes/api/**']
}
},
plugins: [sveltekit()],
});
but this stops the system from registering any changes to the api endpoints.
How do I stop SvelteKit from restarting the browser when code for API endpoints is changed?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745561732a4633146.html
评论列表(0条)