0.1.7 • Published 6 years ago

aws-reply v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

usage:

const AwsReply = require('aws-reply')
const areply = new AwsReply({'X-Default-Header': 'hello'})
// json response
areply.json(callback, error, data [, statusCode])

// html response
areply.html(callback, error, data [, statusCode])

example:

const AwsReply = require('aws-reply')
const areply = new AwsReply() // not setting a default header

module.exports.helloWorld = (event, context, callback) => {
  areply.json(callback, null, {'hello': 'world'})
}


/* response:
{
  'headers': {
  	'Content-Type': 'application/json'
  },
  'statusCode': 200,
  'body': {
  	'success': true,
  	'result': {
  	  'hello': 'world'
  	}
  }
}
*/
0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago