Skip to content

Commit 360a47f

Browse files
Add details for installation and usage in README
1 parent 63b49c3 commit 360a47f

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,51 @@
22

33
Typescript definitions for Serverless service file.
44

5+
## Installation
6+
7+
```
8+
npm i @serverless/typescript --save-dev
9+
```
10+
11+
or
12+
13+
```
14+
yarn add @serverless/typescript --dev
15+
```
16+
17+
## Usage
18+
19+
`serverless.ts` file
20+
21+
```ts
22+
import type { AWS } from '@serverless/typescript';
23+
24+
const serverlessConfiguration: AWS = {
25+
service: 'aws-nodejs-typescript',
26+
},
27+
frameworkVersion: '*',
28+
provider: {
29+
name: 'aws',
30+
runtime: 'nodejs12.x',
31+
},
32+
functions: {
33+
hello: {
34+
handler: 'handler.hello',
35+
events: [
36+
{
37+
http: {
38+
method: 'get',
39+
path: 'hello',
40+
}
41+
}
42+
]
43+
}
44+
}
45+
}
46+
47+
module.exports = serverlessConfiguration;
48+
```
49+
550
## Remaining improvements
651

752
### Use Record<> instead

0 commit comments

Comments
 (0)