0.0.13 • Published 7 years ago

@pinpt/fn v0.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

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.

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago