realworld
realworld copied to clipboard
Cannot create new article
When I clone the repo and run it locally, I cannot create a new article. On the create article form, clicking on the "Publish Article" button disables the button and the form hangs. Developer tools says POST | http://localhost:3000/article.json
was sent with the following response:
404
Not found: /article.json
Error: Not found: /article.json
Is something required in src/routes/article/index.json.js to send the form data to conduit.productionready.io?
Yes. And there should be something returned in index.json.js
or else it will be interpreted as a 404: https://kit.svelte.dev/docs#routing-endpoints
Here's how the old Sapper version worked: https://github.com/sveltejs/realworld/blob/5cd6db62bf8a5db69421f2568c25060054e8da8a/src/routes/editor/_Editor.svelte#L28 https://github.com/sveltejs/realworld/blob/5cd6db62bf8a5db69421f2568c25060054e8da8a/src/node_modules/api.js#L37
I didn't get it. Is it a bug in the code or in the documentation? I haven't seen anything in the README about additional steps to make it work. I understood the purpose of this repo was to serve as a real world example. Isn't it?
There is a bug. It looks like that code never got created when this project was migrated from Sapper to SvelteKit