@pinpt/fn
TypeScript icon, indicating that this package has built-in type declarations

0.0.13 • Public • Published
pinpt-logo

A tiny micro framework for the Serverless framework for building fast λ functions

forthebadge

Setup

More coming soon....

Examples

Single Lambda

import { Logger, Request, Response, λ } from '@pinpt/fn';

export const handler = λ( async (req: Request, resp: Response) => {
  resp.json({data: 'foo'});
});

Paths with simple router

import { LambdaMethod, Logger, Request, Response, λs } from '@pinpt/fn';

export const handler = λs([
  {
		handler: async (req: Request, resp: Response) => {
			resp.json({data: 'foo'});
		},
		method: LambdaMethod.Get,
		path: '/',
	},
	{
		handler: async (req: Request, resp: Response) => {
			resp.json({data: req.params.bar});
		},
		method: LambdaMethod.Post,
		path: '/use/:bar',
	}
]);

License

All of this code is Copyright © 2018 by PinPT, Inc. and licensed under the MIT License. Pull requests welcome.

Readme

Keywords

Package Sidebar

Install

npm i @pinpt/fn

Weekly Downloads

5

Version

0.0.13

License

MIT

Unpacked Size

102 kB

Total Files

51

Last publish

Collaborators

  • jhaynie
  • chrisbowley
  • keegandonley
  • robindiddams