Skip to content

Commit d9b680b

Browse files
authored
Merge pull request #18 from rogelio-o/develop
Develop
2 parents d320699 + 15c5e2b commit d9b680b

3 files changed

Lines changed: 77 additions & 4 deletions

File tree

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,89 @@
22

33
[![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)
44

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)
726

827
## Features
928

1029
- [x] Configurable
1130
- [x] HTTP requests routing
1231
- [x] Other events requests routing
1332
- [x] HTTP helpers (redirection, etc)
33+
- [x] Templating
1434
- [x] Error handling
35+
- [x] For any serverless provider
1536
- [x] Extensible with modules
1637

1738
## How to use it?
1839

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+
1988
TODO
2089

2190
## Contributions

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lambda-framework",
33
"version": "1.0.19",
4-
"description": "Framework to create web apps in AWS Lambda",
4+
"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.",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",
77
"repository": {
@@ -21,7 +21,7 @@
2121
},
2222
"keywords": [
2323
"serverless",
24-
"AWS",
24+
"framework",
2525
"lambda"
2626
],
2727
"author": "Rogelio Orts",

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ export { default as ITemplateLoader } from "./lib/types/http/renderEngine/ITempl
3838
export { default as ITemplateRenderer } from "./lib/types/http/renderEngine/ITemplateRenderer";
3939
export { default as DevTemplateLoader } from "./lib/http/renderEngine/DevTemplateLoader";
4040
export { default as Template } from "./lib/http/renderEngine/Template";
41+
42+
export { default as IRawEvent } from "./lib/types/IRawEvent";
43+
export { default as IRawCallback } from "./lib/types/IRawCallback";
44+
export { default as RawEvent } from "./lib/RawEvent";

0 commit comments

Comments
 (0)