Socket
Socket
Sign inDemoInstall

@gemeentenijmegen/apigateway-http

Package Overview
Dependencies
1
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gemeentenijmegen/apigateway-http

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


Version published
Weekly downloads
198
decreased by-5.26%
Maintainers
4
Install size
169 kB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 09 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc