-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST Methods #5
Comments
The gorilla mux looks like a solution, but maybe we can get away with enabling CORS requests on the web server? Let me know any input you have. https://code.whatever.social/questions/46310113/consume-a-delete-endpoint-from-go |
I think you have to make PUT and DELETE requests with fetch |
As far as the backend / middleware goes, should delete routes / controllers be in their own go files? I've tried supporting multiple methods on handles I'm aware you can sort of achieve what I'm trying to do by switching on the request method, like this https://git.sr.ht/~m15o/midnight-pub/tree/master/item/ui/post_remove.go , but in this framework handlers are segregated by http method into separate controller files. Is there an intended work-around for this issue ? |
New controller files should be named and created according to their purpose like For routes, I suggest having a couple big master files, so it's easy to find the logic associated with them (eg. user reports an error on page So for your use case I'd say make a new routes file called Hopefully this all makes sense. |
Big help! Thanks |
From my research of the docs,
net/http
only handles GET and POST requests. Are there plans to use a mux which can handle PUT or DELETE requests? You can trigger these requests from the templates just like any other form element using htmx.Using Post for deleting/updating will have consequences, since Post isn't idempotent.
The text was updated successfully, but these errors were encountered: