You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Examples/CloudFunctions/README.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
1
# Serverless Cloud Functions Examples
2
2
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.
6
4
7
5
The scripts are prepared to work from the `CloudFunctions` folder.
cd swift-tencent-scf-runtime/Examples/CloudFunctions
12
10
```
13
11
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.
15
13
16
14
## Deployment instructions using TCCLI and COSCMD
17
15
@@ -41,14 +39,14 @@ To use Serverless to deploy this sample to Tencent Cloud:
41
39
42
40
1. Install Serverless by following the [instructions](https://www.serverless.com/framework/docs/getting-started/).
43
41
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.
45
43
46
44
```
47
45
$ serverless --version
48
-
Framework Core: 1.78.1
49
-
Plugin: 3.7.0
46
+
Framework Core: 1.80.0
47
+
Plugin: 3.8.0
50
48
SDK: 2.3.1
51
-
Components: 2.34.1
49
+
Components: 2.34.9
52
50
```
53
51
54
52
2. Build, package and deploy the cloud function
@@ -63,7 +61,7 @@ The script will ask you which sample function you wish to deploy.
63
61
64
62
For the APIGateway sample, the Serverless template provides an endpoint with API Gateway which you can use to test the cloud function.
65
63
66
-
Outuput example:
64
+
Output example:
67
65
68
66
```
69
67
$ sls deploy
@@ -85,10 +83,10 @@ triggers:
85
83
86
84
Full details: https://serverless.cloud.tencent.com/apps/SwiftAPIGatewayDemo/SwiftAPIGatewayDemo/dev
Copy file name to clipboardExpand all lines: README.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,17 @@ When using serverless functions, attention must be given to resource utilization
8
8
9
9
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.
10
10
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.
12
12
13
13
## Project status
14
14
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:
18
16
19
17
* Further performance tuning
20
18
* Additional trigger events
21
19
* Additional documentation and best practices
22
20
* Additional examples
23
21
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
-
26
22
## Getting started
27
23
28
24
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.
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.
362
361
363
362
You can read some contextual variables through `SCF.Context`. All the environment variables can be accessed through `SCF.Env`.
0 commit comments