daliwali/fortune — pull request #50 by nolanlawson (2014-08-16 15:55:39+00:00)
Title: Allow singular post

So currently the server accepts something like this to be POSTed:

```js
{
people: [
{ name: "Dilbert"},
{ name: "Wally"},
]
}
```

But not this:

```js
{
person: { name: "Dilbert"}
}
```

This doesn't seem to conform to the spec, and in particular it breaks when I try to hook up a basic Ember app like [ember-cli-todos](https://github.com/WMeldon/ember-cli-todos) to this server.

In this PR, I've modified the server so that it accepts any combination of e.g. `person`/`people` plus an array/singleton. I think being forgiving makes sense, since otherwise people might get frustrated trying to get their inflections to work correctly (I know I did). I dunno if it conforms exactly to the spec, but since we can programmatically determine what they meant using `Array.isArray`, I don't see the harm in it.