Skip to content

Commit 1ea94d4

Browse files
committed
fix: removing github publish. updating README.
1 parent 71961ba commit 1ea94d4

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
types: [created]
99

1010
jobs:
11-
build:
11+
test:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
@@ -17,10 +17,9 @@ jobs:
1717
node-version: 12
1818
- run: npm ci
1919
- run: npm test
20-
- run: npm run build
2120

2221
publish-npm:
23-
needs: build
22+
needs: test
2423
runs-on: ubuntu-latest
2524
steps:
2625
- uses: actions/checkout@v2
@@ -29,22 +28,7 @@ jobs:
2928
node-version: 12
3029
registry-url: https://registry.npmjs.org/
3130
- run: npm ci
32-
- run: npm build
31+
- run: npm run build
3332
- run: npm publish
3433
env:
3534
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
36-
37-
publish-gpr:
38-
needs: build
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-node@v1
43-
with:
44-
node-version: 12
45-
registry-url: https://npm.pkg.github.com/
46-
- run: npm ci
47-
- run: npm build
48-
- run: npm publish
49-
env:
50-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ exports.handler = async (event: APIGatewayProxyEvent) => {
5454

5555
### Using the `withStatusCode` function
5656

57-
To use the `withStatusCode` you only _need_ to specify the response code and the request origin (for CORS). An example of a simple 200 response is as follows:
57+
To use the `withStatusCode` you only _need_ to specify the response code when declaring the type of response. It is recommended to pass an approved origin for the request if applicable when calling that function. An example of a simple 200 response is as follows:
5858

5959
```
6060
import util from 'lambda-restful-util'
6161
...
62-
const ok = util.withStatusCode(200, 'http://localhost:8080')
62+
const ok = util.withStatusCode(200)
6363
6464
exports.handler = async (event: APIGatewayProxyEvent) => {
6565
...
66-
return ok('Hey Buddy!')
66+
return ok('Hey Buddy!', 'http://localhost:8080')
6767
}
6868
```
6969

@@ -77,7 +77,7 @@ If you know your response is going to be JSON this will simplify converting your
7777

7878
```
7979
...
80-
const ok = util.withStatusCode(util.HttpStatusCode.OK, 'http://localhost:8080, JSON.stringify)
80+
const ok = util.withStatusCode(util.HttpStatusCode.OK, JSON.stringify)
8181
...
8282
const res = {
8383
name: 'Homer Simpson'

0 commit comments

Comments
 (0)