help-me-respond
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "help-me-respond", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Simple node response helper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,4 +12,7 @@ ## Help me respond | ||
2. Setup config | ||
Create config folder and put default.json in it. You will need to add a file with the following to your folder. File naming is up to you :) This is a basic setup for the [i18n-nodejs]: https://github.com/eslam-mahmoud/i18n-nodejs | ||
Create a config folder and put **default.json** in it. (more cool config setup in https://github.com/lorenwest/node-config). | ||
You will need to add the following to your **default.json** file. File naming is up to you :) This is a basic setup for the i18n-nodejs - https://github.com/eslam-mahmoud/i18n-nodejs | ||
``` | ||
@@ -30,3 +33,3 @@ { | ||
"NOT_OWNER": { | ||
"en":"You are not the owner" | ||
"en": "You are not the owner" | ||
} | ||
@@ -36,3 +39,5 @@ } | ||
4. Setup friendly messages. Some messages returned from the server are too technical for the user. So we would like to differentiate between those messages and user friendly messages. Simply add the following to your defaul.json configuration file. Now you can add message names in the friendlyMessages array. | ||
4. Setup friendly messages. | ||
Some messages returned from the server are too technical for the user. So we would like to differentiate between those messages and user friendly messages. Simply add the following to your **default.json** configuration file. Now you can add message names in the friendlyMessages array. | ||
``` | ||
@@ -46,3 +51,3 @@ { | ||
Once the message name is in the above array, the response will have a key friendlyMessage which makes it easy for frontend to differentiate between messages | ||
Once the message name is in the above array, the response will have a key **friendlyMessage** which makes it easy for front-end to differentiate between messages. | ||
@@ -53,3 +58,3 @@ ## API | ||
**msg** - string message, Error object, any other object | ||
**headers** - array with http headers. If none provided the only header set by the library will bw *Content-type*: *application/json* | ||
**headers** - array with http headers. If none provided the only header set by the library will be *Content-type*: *application/json* | ||
@@ -56,0 +61,0 @@ #### http400(res, msg, headers) |
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
6894
125