OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Can you pass JSON Data from Svelte Client side to Server and vice versa?

  • Thread starter Thread starter Damon Medek
  • Start date Start date
D

Damon Medek

Guest
In the documentation you can "preload" server-side data and pass that like a prop to the client using a load function. That makes sense but lets say I'm building a direct message component and need to store user messages in a database, and not use localstorage. Is there a way to pass or update data to the server like fs.writeFileSync to update json backend? Right now I'm setting up an express server-side and svelte just in the front but ideally I'd love for sveltekit to eliminate express. Most info is just passing Data from back to front and thats it, and if you want more you have to signup to a third party db system like mongoDb or supabase, etc.. I just want to update a json file via the client side and have the client side respond to it on future visits.

I've tried localstorage and its not what I want, I want to avoid third party systems like mongo db. I just want Sveltekit to be the full solution without using express for a more robust server.

<p>In the documentation you can "preload" server-side data and pass that like a prop to the client using a load function. That makes sense but lets say I'm building a direct message component and need to store user messages in a database, and not use localstorage. Is there a way to pass or update data to the server like fs.writeFileSync to update json backend? Right now I'm setting up an express server-side and svelte just in the front but ideally I'd love for sveltekit to eliminate express. Most info is just passing Data from back to front and thats it, and if you want more you have to signup to a third party db system like mongoDb or supabase, etc.. I just want to update a json file via the client side and have the client side respond to it on future visits.</p>
<p>I've tried localstorage and its not what I want, I want to avoid third party systems like mongo db. I just want Sveltekit to be the full solution without using express for a more robust server.</p>
 

Latest posts

Top