0.1.7 • Published 8 years ago

aws-reply v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
8 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

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago