Skip to content

Commit e51f156

Browse files
committed
Update README
1 parent db96c60 commit e51f156

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

Examples/CloudFunctions/README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Serverless Cloud Functions Examples
22

3-
This sample project is a collection of cloud functions that demonstrates
4-
how to write a simple SCF function in Swift, and how to package and deploy it
5-
to the Tencent SCF Platform.
3+
This sample project is a collection of cloud functions that demonstrates how to write a simple SCF function in Swift, and how to package and deploy it to the Tencent SCF Platform.
64

75
The scripts are prepared to work from the `CloudFunctions` folder.
86

@@ -11,7 +9,7 @@ git clone https://github.com/stevapple/swift-tencent-scf-runtime.git
119
cd swift-tencent-scf-runtime/Examples/CloudFunctions
1210
```
1311

14-
Note: The example scripts assume you have [jq](https://stedolan.github.io/jq/download/) command line tool installed.
12+
Note: The example scripts assume you have [jq](https://stedolan.github.io/jq/download/) command line tool installed. You're recommended to deploy with Serverless Framework in your own project.
1513

1614
## Deployment instructions using TCCLI and COSCMD
1715

@@ -41,14 +39,14 @@ To use Serverless to deploy this sample to Tencent Cloud:
4139

4240
1. Install Serverless by following the [instructions](https://www.serverless.com/framework/docs/getting-started/).
4341
If you already have installed, be sure you have the latest version.
44-
The examples have been tested with the version 1.78.1.
42+
The examples have been tested with the version 1.80.0.
4543

4644
```
4745
$ serverless --version
48-
Framework Core: 1.78.1
49-
Plugin: 3.7.0
46+
Framework Core: 1.80.0
47+
Plugin: 3.8.0
5048
SDK: 2.3.1
51-
Components: 2.34.1
49+
Components: 2.34.9
5250
```
5351

5452
2. Build, package and deploy the cloud function
@@ -63,7 +61,7 @@ The script will ask you which sample function you wish to deploy.
6361

6462
For the APIGateway sample, the Serverless template provides an endpoint with API Gateway which you can use to test the cloud function.
6563

66-
Outuput example:
64+
Output example:
6765

6866
```
6967
$ sls deploy
@@ -85,10 +83,10 @@ triggers:
8583
8684
Full details: https://serverless.cloud.tencent.com/apps/SwiftAPIGatewayDemo/SwiftAPIGatewayDemo/dev
8785
88-
31s › SwiftAPIGatewayDemo › Success
86+
7s › SwiftAPIGatewayDemo › Success
8987
```
9088

91-
For example:
89+
Test command example:
9290

9391
```
9492
curl http://service-jyl9i6mc-1258834142.bj.apigw.tencentcs.com/release/api
@@ -104,4 +102,4 @@ For extensive usage, you need to customize `serverless.yml` yourself.
104102
./scripts/serverless-remove.sh
105103
```
106104

107-
The script will ask you which sample function you wish to remove from the previous deployment.
105+
The script will ask you which sample function you wish to remove from the previous deployment.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@ When using serverless functions, attention must be given to resource utilization
88

99
Combine this with Swift's developer friendliness, expressiveness, and emphasis on safety, and we have a solution that is great for developers at all skill levels, scalable, and cost effective.
1010

11-
Swift Tencent SCF Runtime is a forked version form [Swift AWS Lambda Runtime](https://github.com/swift-server/swift-aws-lambda-runtime), designed to make building cloud functions in Swift simple and safe. The library is an implementation of the [Tencent SCF Custom Runtime API](https://cloud.tencent.com/document/product/583/47274#custom-runtime-.E8.BF.90.E8.A1.8C.E6.97.B6-api) and uses an embedded asynchronous HTTP Client based on [SwiftNIO](http://github.com/apple/swift-nio) that is fine-tuned for performance in the SCF Custom Runtime context. The library provides a multi-tier API that allows building a range of cloud functions: From quick and simple Closures to complex, performance-sensitive event handlers.
11+
Swift Tencent SCF Runtime is a forked version from [Swift AWS Lambda Runtime](https://github.com/swift-server/swift-aws-lambda-runtime), designed to make building cloud functions in Swift simple and safe. The library is an implementation of the [Tencent SCF Custom Runtime API](https://cloud.tencent.com/document/product/583/47274#custom-runtime-.E8.BF.90.E8.A1.8C.E6.97.B6-api) and uses an embedded asynchronous HTTP Client based on [SwiftNIO](http://github.com/apple/swift-nio) that is fine-tuned for performance in the SCF Custom Runtime context. The library provides a multi-tier API that allows building a range of cloud functions: From quick and simple Closures to complex, performance-sensitive event handlers.
1212

1313
## Project status
1414

15-
This is the beginning of an open-source project actively seeking contributions.
16-
While the core API is considered stable, the API may still evolve as we get closer to a `1.0` version.
17-
There are several areas which need additional attention, including but not limited to:
15+
This is the beginning of an open-source project actively seeking contributions. While the core API is considered stable, the API may still evolve as we get closer to a `1.0` version. There are several areas which need additional attention, including but not limited to:
1816

1917
* Further performance tuning
2018
* Additional trigger events
2119
* Additional documentation and best practices
2220
* Additional examples
2321

24-
By August 2020, [SCF Custom Runtime](https://cloud.tencent.com/document/product/583/47274) is also at an early stage. You may encounter some problems triggered by the SCF Runtime Engine itself, or the API changes and deprecations. You are welcome to open issues actively on those problems.
25-
2622
## Getting started
2723

2824
If you have used [Swift AWS Lambda Runtime](https://github.com/swift-server/swift-aws-lambda-runtime), you may find most of the APIs familiar. If you have never used Tencent SCF, AWS Lambda or Docker before, check out this [getting started guide](https://fabianfett.de/getting-started-with-swift-aws-lambda-runtime) which helps you with every step from zero to a running cloud function.
@@ -36,6 +32,9 @@ import PackageDescription
3632

3733
let package = Package(
3834
name: "my-cloud-function",
35+
platforms: [
36+
.macOS(.v10_13),
37+
],
3938
products: [
4039
.executable(name: "MyCloudFunction", targets: ["MyCloudFunction"]),
4140
],
@@ -358,7 +357,7 @@ SCF.run { (context, name: String, callback: @escaping (Result<String, Error>) ->
358357
}
359358
```
360359

361-
We simulate the SCF environment with some variables set by default. The value set by user code is of the highest priority, while the framework simulation has the lowest.
360+
We simulate the [SCF environment](https://cloud.tencent.com/document/product/583/30228) with some variables set by default. The value set by user code is of the highest priority, while the framework's default has the lowest.
362361

363362
You can read some contextual variables through `SCF.Context`. All the environment variables can be accessed through `SCF.Env`.
364363

0 commit comments

Comments
 (0)