3 ms·
Hey Peter-- RESTful endpoints are supported. The other options are just there for convenience while testing. You can disable those routes later if you like in
by mikermcneil 14y ago
Hey Peter-- RESTful endpoints are supported. The other options are just there for convenience while testing. You can disable those routes later if you like in your routing table. Policy mapping happens at a controller level to solve this very problem and prevent devs from inadvertently granting access to a piece of code they didn't mean to.
# List of all users
http://localhost:1337/user http://localhost:1337/user
# Find the user with id 1
http://localhost:1337/user/1 http://localhost:1337/user/1
# Create a new user
http://localhost:1337/user/create?name=Fisslewick http://localhost:1337/user/create?name=Fisslewick
(or send an HTTP POST to http://localhost:1337/user http://localhost:1337/user)
# Update the name of the user with id 1
http://localhost:1337/user/update/1?name=Gordo http://localhost:1337/user/update/1?name=Gordo
(or send an HTTP PUT to http://localhost:1337/user/1 http://localhost:1337/user/1)
# Destroy the user with id 1
http://localhost:1337/user/destroy/1 http://localhost:1337/user/destroy/1
(or send an HTTP DELETE to http://localhost:1337/user/1 http://localhost:1337/user/1)
- smrtinsert 14y agohow would you delete the incorrectly created key from the video? nice work btw, the end to end of it is attractive if somewhat magical.
- peter_l_downs 14y agoI saw that the RESTful endpoints also existed, I was just curious about the additional ones. Knowing that I can easily choose to disable them is great to know — maybe mention it in the docs? I think that exposing these routes for testing is a great idea, but depending on them in production would be rather terrible and dangerous.