rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 312 forks source link

Handling non-GET method requests #342

Closed nhunzaker closed 10 years ago

nhunzaker commented 10 years ago

What is the suggested method for updating/creating a new record? For example, if I want to manage user registration or authentication. It seems like GET is the only verb I have access to. Should this be placed directly on the express server, or do you recommend posting directly with the targeted API?

ryan-rowland commented 10 years ago

Can you give an example of your use-case? Specifically, where you can only access GET?

nhunzaker commented 10 years ago

Like if I wanted create a record, the verb for this is POST, but I couldn't find anything on setting up a route for this. When I looked under the hood, I found this line that makes it seem like routes.js can only configure GET routes.

Is this incorrect?

lo1tuma commented 10 years ago

Yes this is correct. You need a decoupled REST API and then you can create records the backbone way like model.save. routes.js is more like the backbone router it only handle routes for views.

nhunzaker commented 10 years ago

Cool, that totally makes sense. Thanks!