Skip to content

Use standard result field in data and error objects returned from an express application

License

Notifications You must be signed in to change notification settings

mindiply/express-json-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-json-utils

Use standard result field in data and error objects returned from an express application

The API consists of 2 functions:

  • sendJSONResult(res, data) which sends an object of the format: { result : 'ok', data_field_1 : data_field_1_value, ...} back via res.send

  • sendJSONError(res, err, msg) which sends and object of the format: { result : 'error', msg : msg, err : err } via res.send

License

Apache 2.0

About

Use standard result field in data and error objects returned from an express application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published