Socket
Socket
Sign inDemoInstall

@valora/http-handler

Package Overview
Dependencies
1
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @valora/http-handler

Handle logging and errors in your Google Cloud Function HTTP endpoint implementations.


Version published
Weekly downloads
1.8K
increased by18.56%
Maintainers
10
Created
Weekly downloads
 

Readme

Source

@valora/http-handler

Handle logging and errors in your Google Cloud Function HTTP endpoint implementations.

Development

Install dependencies:

yarn

Run tests:

yarn test

Using

Add @valora/http-handler:

yarn add @valora/http-handler

Define your HttpFunction:

import {
  HttpFunction,
  Request,
  Response,
} from '@google-cloud/functions-framework/build/src/functions'
import { createLogger } from '@valora/logging'
import { asyncHandler } from '@valora/http-handler'

// Any Bunyan logger
const logger = createLogger()

const requestHandler: HttpFunction = async (req: Request, res: Response) => {
  res.status(200).send({ message: 'hello' })
}

const export helloCloudFunctionHandler = asyncHandler(requestHandler, logger)

FAQs

Last updated on 11 Apr 2023

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