Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 71 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,89 @@

[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1314/badge)](https://bestpractices.coreinfrastructure.org/projects/1314) [![Coverage Status](https://coveralls.io/repos/github/rogelio-o/lambda-framework/badge.svg?branch=master)](https://coveralls.io/github/rogelio-o/lambda-framework?branch=master) [![Build Status](https://travis-ci.org/rogelio-o/lambda-framework.svg?branch=master)](https://travis-ci.org/rogelio-o/lambda-framework) [![npm version](https://badge.fury.io/js/lambda-framework.svg)](https://badge.fury.io/js/lambda-framework)

A framework to create serverless web applications in AWS Lambda. It is based
on Express Framework.
A framework to create serverless web applications with any provider.

This is the core project, you can use it with an official implementation of a provider
or you can implement your own provider. For more information, please keep reading.

The idea behind Lambda Framework is that you can use the features of the framework
forgetting the provider you are using. Thus, you can change the provider without
change your code base. The only thing you have to do for change the provider is
change the lib that implements the one provider for other, but the core will be
the same.

## Lambda Framework projects

Lambda Framework is very modular. This is because the lambda functions have to be
lightweight. You can use the projects you need in your web application.

- [Core](https://github.com/rogelio-o/lambda-framework)
- [AWS Lambda implementation](https://github.com/rogelio-o/lambda-framework-aws)
- [DustJS template engine implementation for Lambda Framework](https://github.com/rogelio-o/lambda-framework-dustjs)
- [Website](https://github.com/rogelio-o/lambda-framework-website)
- [Website Resources](https://github.com/rogelio-o/lambda-framework-website-resources)

## Features

- [x] Configurable
- [x] HTTP requests routing
- [x] Other events requests routing
- [x] HTTP helpers (redirection, etc)
- [x] Templating
- [x] Error handling
- [x] For any serverless provider
- [x] Extensible with modules

## How to use it?

### Initialize the App

The main object is the App. You have to instantiate a new App object and then
you can do what you need with it.
```typescript
import App, { IApp } from "lambda-framework";

const app: IApp = new App();
```

A event handling is started passing that event to the App method `handle`.
```typescript
app.handle(event, callback);
```

You don't need to care about passing the event to the App handler, you can use the [AWS Lambda implementation](https://github.com/rogelio-o/lambda-framework-aws) or another provider
implementation. These will manage the creation of the raw event and passing it to the handler.
```typescript
import App, { IApp } from "lambda-framework";
import AWSHandler from "lambda-framework-aws";

const app: IApp = new App();
...
export.handler = AWSHandler(app);
```

### Event handling

TODO

### HTTP Routing

TODO

### HTTP body parsers

TODO

### Others HTTP features

TODO

### Templating

TODO

### More info, API and tutorials

TODO

## Contributions
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lambda-framework",
"version": "1.0.19",
"description": "Framework to create web apps in AWS Lambda",
"description": "Framework to create web apps with any provider. This is the core, you can use it with an official provider implementation or you can implement your own provider.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"repository": {
Expand All @@ -21,7 +21,7 @@
},
"keywords": [
"serverless",
"AWS",
"framework",
"lambda"
],
"author": "Rogelio Orts",
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ export { default as ITemplateLoader } from "./lib/types/http/renderEngine/ITempl
export { default as ITemplateRenderer } from "./lib/types/http/renderEngine/ITemplateRenderer";
export { default as DevTemplateLoader } from "./lib/http/renderEngine/DevTemplateLoader";
export { default as Template } from "./lib/http/renderEngine/Template";

export { default as IRawEvent } from "./lib/types/IRawEvent";
export { default as IRawCallback } from "./lib/types/IRawCallback";
export { default as RawEvent } from "./lib/RawEvent";