wprl/baucis — pull request #101 by lukaszfiszer (2013-12-27 02:33:36+00:00)
Title: Replace DEL with DELETE verb

I've noticed few incorect behaviours around DELETE verb:

1) When `del` verb is disabled on the controller (like on the configuration below), I get 404 instead of expected 405:

```
baucis.rest({
singular: 'fruit',
del: false
});
```

```
$ curl -i -X DELETE http://localhost:8081/api/fruits/52bccc3c3e9dede401000003
HTTP/1.1 404 Not Found
X-Powered-By: Baucis
Allow: HEAD,GET,POST,PUT
(...)

Cannot DELETE /api/fruits/52bccc3c3e9dede401000003
```

2) In all responses send by baucis `Allow` header is response incorrectly lists `DEL` as supported verb instead of `DELETE` (there is no such HTTP method as `DEL`)

```
$ curl -i -X GET http://localhost:8081/api/fruits/52bccc3c3e9dede401000003
HTTP/1.1 200 OK
X-Powered-By: Baucis
Allow: HEAD,GET,POST,PUT,DEL
(...)

{
"name": "Foo",
"_id": "52bccc3c3e9dede401000003",
"__v": 0
}
```

3) Swagger probably also lists `DEL` method instead of `DELETE`, but i haven't verified that.

This PR correct this issue. It also changes some internal method names from `del` to `delete` to increase the consistency. Changes are not significant, mainly because for express.js `app.del = app.delete`. All unit tests pass smoothly.

However, the are 2 breaking changes in the baucis public API:

1, Controller middleware: `controller.query('del', function () {})` becomes `controller.query('delete', function () {})`
2. Controller options: `baucis.rest({singular: 'bar', del: false})` becomes `baucis.rest({singular: 'bar', delele: false})`

Tell me what's your opinion on this change. If you're OK, I can update docs accordingly.