|
2 | 2 |
|
3 | 3 | [](https://bestpractices.coreinfrastructure.org/projects/1314) [](https://coveralls.io/github/rogelio-o/lambda-framework?branch=master) [](https://travis-ci.org/rogelio-o/lambda-framework) [](https://badge.fury.io/js/lambda-framework) |
4 | 4 |
|
5 | | -A framework to create serverless web applications in AWS Lambda. It is based |
6 | | -on Express Framework. |
| 5 | +A framework to create serverless web applications with any provider. |
| 6 | + |
| 7 | +This is the core project, you can use it with an official implementation of a provider |
| 8 | +or you can implement your own provider. For more information, please keep reading. |
| 9 | + |
| 10 | +The idea behind Lambda Framework is that you can use the features of the framework |
| 11 | +forgetting the provider you are using. Thus, you can change the provider without |
| 12 | +change your code base. The only thing you have to do for change the provider is |
| 13 | +change the lib that implements the one provider for other, but the core will be |
| 14 | +the same. |
| 15 | + |
| 16 | +## Lambda Framework projects |
| 17 | + |
| 18 | +Lambda Framework is very modular. This is because the lambda functions have to be |
| 19 | +lightweight. You can use the projects you need in your web application. |
| 20 | + |
| 21 | +- [Core](https://github.com/rogelio-o/lambda-framework) |
| 22 | +- [AWS Lambda implementation](https://github.com/rogelio-o/lambda-framework-aws) |
| 23 | +- [DustJS template engine implementation for Lambda Framework](https://github.com/rogelio-o/lambda-framework-dustjs) |
| 24 | +- [Website](https://github.com/rogelio-o/lambda-framework-website) |
| 25 | +- [Website Resources](https://github.com/rogelio-o/lambda-framework-website-resources) |
7 | 26 |
|
8 | 27 | ## Features |
9 | 28 |
|
10 | 29 | - [x] Configurable |
11 | 30 | - [x] HTTP requests routing |
12 | 31 | - [x] Other events requests routing |
13 | 32 | - [x] HTTP helpers (redirection, etc) |
| 33 | +- [x] Templating |
14 | 34 | - [x] Error handling |
| 35 | +- [x] For any serverless provider |
15 | 36 | - [x] Extensible with modules |
16 | 37 |
|
17 | 38 | ## How to use it? |
18 | 39 |
|
| 40 | +### Initialize the App |
| 41 | + |
| 42 | +The main object is the App. You have to instantiate a new App object and then |
| 43 | +you can do what you need with it. |
| 44 | +```typescript |
| 45 | +import App, { IApp } from "lambda-framework"; |
| 46 | + |
| 47 | +const app: IApp = new App(); |
| 48 | +``` |
| 49 | + |
| 50 | +A event handling is started passing that event to the App method `handle`. |
| 51 | +```typescript |
| 52 | +app.handle(event, callback); |
| 53 | +``` |
| 54 | + |
| 55 | +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 |
| 56 | +implementation. These will manage the creation of the raw event and passing it to the handler. |
| 57 | +```typescript |
| 58 | +import App, { IApp } from "lambda-framework"; |
| 59 | +import AWSHandler from "lambda-framework-aws"; |
| 60 | + |
| 61 | +const app: IApp = new App(); |
| 62 | +... |
| 63 | +export.handler = AWSHandler(app); |
| 64 | +``` |
| 65 | + |
| 66 | +### Event handling |
| 67 | + |
| 68 | +TODO |
| 69 | + |
| 70 | +### HTTP Routing |
| 71 | + |
| 72 | +TODO |
| 73 | + |
| 74 | +### HTTP body parsers |
| 75 | + |
| 76 | +TODO |
| 77 | + |
| 78 | +### Others HTTP features |
| 79 | + |
| 80 | +TODO |
| 81 | + |
| 82 | +### Templating |
| 83 | + |
| 84 | +TODO |
| 85 | + |
| 86 | +### More info, API and tutorials |
| 87 | + |
19 | 88 | TODO |
20 | 89 |
|
21 | 90 | ## Contributions |
|
0 commit comments