@gemeentenijmegen/apigateway-http
TypeScript icon, indicating that this package has built-in type declarations

0.0.16 • Public • Published

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' });

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.16
269latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.16
269
0.0.15
0
0.0.14
0
0.0.13
0
0.0.12
0
0.0.11
0
0.0.80
0.0.77
0.0.60
0.0.51
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i @gemeentenijmegen/apigateway-http

Weekly Downloads

277

Version

0.0.16

License

EUPL-1.2

Unpacked Size

26.6 kB

Total Files

7

Last publish

Collaborators

  • wkremer
  • marnixdessing
  • bramwithaar
  • martijnvdijk
  • jvanderborg