Skip to content

Commit

Permalink
docs(readme): added examples section to link with example repository
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed May 26, 2022
1 parent a92254a commit 28c488c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<a href="#install">Install</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#usage">Usage</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#support">Support</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#examples">Examples</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#architecture">Architecture</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
<a href="#credits">Credits</a>
</p>
Expand Down Expand Up @@ -227,17 +228,26 @@ import { ServerlessAdapter } from '@h4ad/serverless-adapter';
import { HuaweiApiGatewayAdapter } from '@h4ad/serverless-adapter/lib/adapters/huawei';
import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
import { DefaultHandler } from '@h4ad/serverless-adapter/lib/handlers/default';
import { PromiseResolver } from '@h4ad/serverless-adapter/lib/resolvers/promise';
import { CallbackResolver } from '@h4ad/serverless-adapter/lib/resolvers/callback';
import app from './app';

export const handler = ServerlessAdapter.new(app)
.setFramework(new ExpressFramework())
.setHandler(new DefaultHandler())
.setResolver(new PromiseResolver())
.setResolver(new CallbackResolver())
.addAdapter(new HuaweiApiGatewayAdapter())
.build();
```

#### One important thing

You must use the callback resolver because I couldn't get it to work with the PromiseResolver.
Maybe it's a bug in the library or something specific in Huawei, if you have a tip please create an issue.

# Examples

You can see some examples of how to use this library [here](https://github.com/H4ad/serverless-adapter-examples).

# Architecture

The main purpose of this library is to allow the developer to add support for any cloud and as many event sources as he
Expand Down

0 comments on commit 28c488c

Please sign in to comment.