This is probably a stupid question but I needed to ask this because it's been a long time since I developed my last web app with raw PHP. So basically I'm was a raw PHP developer. So I know raw PHP, MySQL, HTML, CSS and some Javascript. I'm starting again and I decided to make something simple with CRUD operations. I looked at Svelte/Sapper and it looks interesting. So how do I send form data to a backend PHP API and how do I fetch data from that PHP API? Thanks in advance.
You basically created CRUD endpoints that render server responses based on the URL and HTTP method (so post for adding data, patch for changing data, delete for removing data etc.) — read about REST and architecture of that 👍🏻
This comment was deleted 4 years ago.
Just to make sure you are aware, in JavaScript front you can add
On a line in your code to add a breakpoint. Much like
pdbin python. If you are trying to debug a front end app with inspector open it will pause the code getting executed on this lineYou can then find out what all the different variable values are and step through you code etc.
This comment was deleted 4 years ago.
Oh I feel you, I much prefer Python to Javascript when I can. I find a large number of JS packages etc hard to read due to odd code styles etc.
Just as a note on JS linters, I pretty much always install eslint-config-airbnb for any project I start with JS. It uses ESLint to enforce the Airbnb JavaScript Style Guide which I find sane.
It doesn't make other peoples code easier to read but I find it keeps my code easy enough to pick back up when I need to.
Thank you. You are right, I was a little confused. I thought Sapper would not be able to handle backend. I guess I have to learn it more thoroughly.