express-semantic-response
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "express-semantic-response", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Remembering which response code to use is error prone and unsexy. Let these semantic response extensions increase your sex-appeal and reduce your error-pronity.", | ||
@@ -8,2 +8,3 @@ "main": "src/index.js", | ||
"license": "MIT", | ||
"repository": "prodatakey/express-semantic-response", | ||
"peerDependencies": { | ||
@@ -10,0 +11,0 @@ "express": ">4.0.0" |
@@ -15,1 +15,16 @@ This module extends express' response object with semantic syntactic sugar that makes responding to API requests less error-prone. | ||
The response object on all requests made to your app will now have all of the helpers defined in this module. | ||
##Response Handlers | ||
###res.sendDeleted() | ||
When deleting an entity we send a 204 'No Content' status with no body | ||
###res.sendCreated(location, body) | ||
When creating an entity we send: | ||
- A location header pointing to the created entity | ||
- The newly created entity as the body | ||
- Status 201 'Created' | ||
####Parameters | ||
* **location** - The location of the created entity to set in the `Location` header. | ||
* **body** - The object that was created to send back to the client. This serializes the content using the same semantics as [send](http://expressjs.com/api.html#res.send). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
1035898
30