Skip to content

Commit

Permalink
fix: Chang /ping path to /time in several examples (serverless#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardstrnad authored Dec 2, 2021
1 parent b00b9c8 commit 48d7f61
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions aws-java-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
title: 'AWS Simple HTTP Endpoint example in Java'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint using Java. Once you ping it, it will reply with the current time.'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint using Java. Once you fetch it, it will reply with the current time.'
layout: Doc
framework: v1
platform: AWS
Expand All @@ -12,7 +12,7 @@ authorAvatar: 'https://avatars3.githubusercontent.com/u/1767769?v=4&s=140'
-->
# Simple HTTP Endpoint Example

This example demonstrates how to setup a simple HTTP GET endpoint using Java. Once you ping it, it will reply with the current time.
This example demonstrates how to setup a simple HTTP GET endpoint using Java. Once you fetch it, it will reply with the current time.

[Jackson](https://github.com/FasterXML/jackson) is used to serialize objects to JSON.

Expand Down Expand Up @@ -110,7 +110,7 @@ region: us-east-1
api keys:
None
endpoints:
GET - https://XXXXXXX.execute-api.us-east-1.amazonaws.com/ping
GET - https://XXXXXXX.execute-api.us-east-1.amazonaws.com/time
functions:
aws-java-simple-http-endpoint-dev-currentTime: arn:aws:lambda:us-east-1:XXXXXXX:function:aws-java-simple-http-endpoint-dev-currentTime

Expand Down Expand Up @@ -146,7 +146,7 @@ REPORT RequestId: XXXXXXX Duration: 0.51 ms Billed Duration: 100 ms Memory Size
Finally you can send an HTTP request directly to the endpoint using a tool like curl

```bash
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/ping
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/time
```

The expected result should be similar to:
Expand Down
2 changes: 1 addition & 1 deletion aws-java-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ functions:
handler: com.serverless.Handler
events:
- httpApi:
path: /ping
path: /time
method: get
8 changes: 4 additions & 4 deletions aws-node-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
title: 'AWS Simple HTTP Endpoint example in NodeJS'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you ping it, it will reply with the current time.'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you fetch it, it will reply with the current time.'
layout: Doc
framework: v1
platform: AWS
Expand All @@ -12,7 +12,7 @@ authorAvatar: 'https://avatars0.githubusercontent.com/u/8188?v=4&s=140'
-->
# Simple HTTP Endpoint Example

This example demonstrates how to setup a simple HTTP GET endpoint. Once you ping it, it will reply with the current time. While the internal function is name `currentTime` the HTTP endpoint is exposed as `ping`.
This example demonstrates how to setup a simple HTTP GET endpoint. Once you fetch it, it will reply with the current time. While the internal function is name `currentTime` the HTTP endpoint is exposed as `time`.

## Use Cases

Expand Down Expand Up @@ -61,7 +61,7 @@ region: us-east-1
api keys:
None
endpoints:
GET - https://2e16njizla.execute-api.us-east-1.amazonaws.com/ping
GET - https://2e16njizla.execute-api.us-east-1.amazonaws.com/time
functions:
serverless-simple-http-endpoint-dev-currentTime: arn:aws:lambda:us-east-1:488110005556:function:serverless-simple-http-endpoint-dev-currentTime
```
Expand All @@ -77,7 +77,7 @@ serverless invoke --function currentTime --log
or as send an HTTP request directly to the endpoint using a tool like curl

```bash
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/ping
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/time
```

## Scaling
Expand Down
2 changes: 1 addition & 1 deletion aws-node-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ functions:
handler: handler.endpoint
events:
- httpApi:
path: /ping
path: /time
method: get
8 changes: 4 additions & 4 deletions aws-python-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
title: 'AWS Simple HTTP Endpoint example in Python'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you ping it, it will reply with the current time.'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you fetch it, it will reply with the current time.'
layout: Doc
framework: v1
platform: AWS
Expand All @@ -12,7 +12,7 @@ authorAvatar: 'https://avatars0.githubusercontent.com/u/8188?v=4&s=140'
-->
# Simple HTTP Endpoint Example

This example demonstrates how to setup a simple HTTP GET endpoint. Once you ping it, it will reply with the current time. While the internal function is name `currentTime` the HTTP endpoint is exposed as `ping`.
This example demonstrates how to setup a simple HTTP GET endpoint. Once you fetch it, it will reply with the current time. While the internal function is name `currentTime` the HTTP endpoint is exposed as `time`.

## Use Cases

Expand Down Expand Up @@ -42,7 +42,7 @@ region: us-east-1
api keys:
None
endpoints:
GET - https://f7r5srabr3.execute-api.us-east-1.amazonaws.com/ping
GET - https://f7r5srabr3.execute-api.us-east-1.amazonaws.com/time
functions:
currentTime: aws-python-simple-http-endpoint-dev-currentTime
```
Expand Down Expand Up @@ -71,7 +71,7 @@ REPORT RequestId: a26699d3-b3ee-11e6-98f33f952e8294 Duration: 0.23 ms Billed Dur
Finally you can send an HTTP request directly to the endpoint using a tool like curl

```bash
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/ping
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/time
```

The expected result should be similar to:
Expand Down
2 changes: 1 addition & 1 deletion aws-python-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ functions:
handler: handler.endpoint
events:
- httpApi:
path: /ping
path: /time
method: get
6 changes: 3 additions & 3 deletions aws-ruby-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
title: .'AWS Simple HTTP Endpoint example in Ruby'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you ping it, it will reply with the current time.'
description: 'This example demonstrates how to setup a simple HTTP GET endpoint. Once you fetch it, it will reply with the current time.'
framework: v1
platform: AWS
language: Ruby
Expand Down Expand Up @@ -47,7 +47,7 @@ stack: serverless-ruby-simple-http-endpoint-dev
api keys:
None
endpoints:
GET - https://spmfbzc6ja.execute-api.us-east-1.amazonaws.com/ping
GET - https://spmfbzc6ja.execute-api.us-east-1.amazonaws.com/time
functions:
current_time: serverless-ruby-simple-http-endpoint-dev-current_time
layers:
Expand All @@ -59,7 +59,7 @@ Serverless: Removing old service artifacts from S3...
Send an HTTP request directly to the endpoint using a tool like curl:

```bash
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/ping
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/time
```

## Scaling
Expand Down
2 changes: 1 addition & 1 deletion aws-ruby-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ functions:
handler: handler.endpoint
events:
- httpApi:
path: /ping
path: /time
method: get
6 changes: 3 additions & 3 deletions openwhisk-python-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Make a note of the API endpoint that is logged to the console during deployment.

```
endpoints:
GET https://xxx.api-gw.mybluemix.net/python-service/ping --> python-service-dev-currentTime
GET https://xxx.api-gw.mybluemix.net/python-service/time --> python-service-dev-currentTime
```

## 3. Invoke deployed function
Expand All @@ -49,14 +49,14 @@ be the API gateway root path, logged during deployment, and your configured
function path.

```
$ http get https://xxx.api-gw.mybluemix.net/python-service/ping
$ http get https://xxx.api-gw.mybluemix.net/python-service/time
HTTP/1.1 200 OK
...
{
"message": "Hello stranger, the current time is 16:00:11.837331"
}
$ http get https://xxx.api-gw.mybluemix.net/python-service/ping?name=James
$ http get https://xxx.api-gw.mybluemix.net/python-service/time?name=James
HTTP/1.1 200 OK
...
{
Expand Down
2 changes: 1 addition & 1 deletion openwhisk-python-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ functions:
handler: handler.endpoint
events:
- http:
path: ping
path: time
method: get

plugins:
Expand Down
8 changes: 4 additions & 4 deletions openwhisk-swift-simple-http-endpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Make a note of the API endpoint that is logged to the console during deployment.

```
endpoints:
GET https://xxx.api-gw.mybluemix.net/swift-service/ping --> swift-service-dev-ping
GET https://xxx.api-gw.mybluemix.net/swift-service/time --> swift-service-dev-time
```

## 3. Invoke deployed function
`serverless invoke --function ping` or `serverless invoke -f ping`
`serverless invoke --function time` or `serverless invoke -f time`

`-f` is shorthand for `--function`

Expand All @@ -49,14 +49,14 @@ be the API gateway root path, logged during deployment, and your configured
function path.

```
$ http get https://xxx.api-gw.mybluemix.net/swift-service/ping
$ http get https://xxx.api-gw.mybluemix.net/swift-service/time
HTTP/1.1 200 OK
...
{
"message": "Hello stranger, the current time is 16:00:11.837331"
}
$ http get https://xxx.api-gw.mybluemix.net/swift-service/ping?name=James
$ http get https://xxx.api-gw.mybluemix.net/swift-service/time?name=James
HTTP/1.1 200 OK
...
{
Expand Down
6 changes: 3 additions & 3 deletions openwhisk-swift-simple-http-endpoint/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ provider:
runtime: swift

functions:
ping:
handler: ping.main
time:
handler: time.main
events:
- http:
path: ping
path: time
method: get


Expand Down

0 comments on commit 48d7f61

Please sign in to comment.