rethinkdb / rethinkdb-example-nodejs

137 stars 98 forks source link

endpoints seem wrong? #10

Open ralyodio opened 9 years ago

ralyodio commented 9 years ago
app.get('/todo/get', get);
app.put('/todo/new', create);
app.post('/todo/update', update);
app.post('/todo/delete', del);

Should it be this?

app.get('/todo/:id', get);
app.put('/todo/:id', update);
app.post('/todo', create);
app.delete('/todo/:id', del);

Just curious why the weird endpoints and swap of post vs. put handling.

coffeemug commented 9 years ago

I don't think there is a reason -- whoever wrote the example didn't seem to follow convention. We should probably update the example to use canonical REST conventions. Thanks @chovy.

danielmewes commented 9 years ago

Pinging @deontologician (though I think this isn't super critical).

deontologician commented 9 years ago

It's in my queue, pull requests welcome though

On Tue, May 19, 2015 at 11:09 AM Daniel Mewes notifications@github.com wrote:

Assigned #10 https://github.com/rethinkdb/rethinkdb-example-nodejs/issues/10 to @deontologician https://github.com/deontologician.

— Reply to this email directly or view it on GitHub https://github.com/rethinkdb/rethinkdb-example-nodejs/issues/10#event-308753774 .

Prinzhorn commented 9 years ago

I did fix this for the rewrite I did (https://github.com/rethinkdb/rethinkdb-example-nodejs/blob/cbe726b46e40eb7e6b9c7c422ae0c08ba2ded037/todo-angular-express/app.js) which someone needs to port to promises and koa. #7

ralyodio commented 9 years ago

woops. wrong button

I can help out with rewriting for koa