0.0.8 • Published 3 months ago

@gemeentenijmegen/apigateway-http v0.0.8

Weekly downloads
-
License
EUPL-1.2
Repository
github
Last release
3 months ago

AWS Apigateway HTTP helpers

A package useful when developing serverless functions using AWS Lambda/Apigateway. It contains:

V2/Response

A response object with several methods for common http responses. Return these from your lambda handler:

import { Response } from '@gemeentenijmegen/apigateway-http/lib/V2/Response';

// Redirect to https://example.com
Response.redirect('https://example.com');

// Permanently redirect to https://example.com
Response.redirect('https://example.com', 301);

// Return http 403: Not allowed response
Response.error(403);

// Return a html page
Response.html('<!doctype html><html><head><title>My page</title></head><body>The html body</body></html>');

// Return a json response from a javascript object
Response.html({ key: 'value' });
0.0.8

3 months ago

0.0.7

9 months ago

0.0.6

11 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago