As long as you're just working on JavaScript code for the front end, wouldn't it make sense to write this in node? That way you can avoid context switching. I'd daresay this would be much simpler in JavaScript as well, to the point that a tutorial isn't really necessary.
Here's a quick take. I'm sure it can be cleaned up further. I've also taken the liberty of fixing the delete before post id bug.
You don't need attributes based routing in this example. Convention based routing is built into WebAPI.
For the Delete method you can return an HttpStatusCode instead of throwing an exception.
public IHttpActionResult Delete(int Id)
{
var result = (from b in ourbooks
where b.Id == Id
select b).FirstOrDefault();
ourbooks.Remove(result);
return StatusCode(HttpStatusCode.Accepted);
}
i've been using apiary this week and it's been absolutely fantastic so far. Markdown goes in, API docs + mock live API comes out, even syncs with github.
it's definitely a great tool, it's really useful being able to chop and change in the early stages of designing an API without being committed in the code.
Does anyone know of a similar guide for Ruby?
I'm an ASP.net developer and I'm trying to get some insight into other (perhaps quicker/easier) ways of doing exactly what this guide describes.
That's the first time I've heard that meaning of "self hosted." I was expecting something like a REST server that also acted as a client to another instance of itself.
Here's a quick take. I'm sure it can be cleaned up further. I've also taken the liberty of fixing the delete before post id bug.