1
1
# Local Debugging Example
2
2
3
- This sample project demonstrates how to write a simple Lambda function in Swift,
4
- and how to use local debugging techniques that simulate how the Lambda function
5
- would be invoked by the AWS Lambda Runtime engine.
3
+ This sample project demonstrates how to write a simple SCF function in Swift,
4
+ and how to use local debugging techniques that simulate how the SCF function
5
+ would be invoked by the Tencent SCF Runtime engine.
6
6
7
7
The example includes an Xcode workspace with three modules:
8
8
9
- 1 . [ MyApp] ( MyApp ) is a SwiftUI iOS application that calls the Lambda function.
10
- 2 . [ MyCloudFunction] ( MyCloudFunction ) is a SwiftPM executable package for the Lambda function.
9
+ 1 . [ MyApp] ( MyApp ) is a SwiftUI iOS application that calls the SCF function.
10
+ 2 . [ MyCloudFunction] ( MyCloudFunction ) is a SwiftPM executable package for the SCF function.
11
11
3 . [ Shared] ( Shared ) is a SwiftPM library package used for shared code between the iOS application and the Lambda function,
12
12
such as the Request and Response model objects.
13
13
14
- The local debugging experience is achieved by running the Lambda function in the context of the
14
+ The local debugging experience is achieved by running the SCF function in the context of the
15
15
debug-only local lambda engine simulator which starts a local HTTP server enabling the communication
16
- between the iOS application and the Lambda function over HTTP.
16
+ between the iOS application and the SCF function over HTTP.
17
17
18
18
To try out this example, open the workspace in Xcode and "run" the two targets,
19
19
using the relevant ` MyCloudFunction ` and ` MyApp ` Xcode schemes.
@@ -23,7 +23,7 @@ Start with running the `MyCloudFunction` target.
23
23
* Set the ` LOCAL_SCF_SERVER_ENABLED ` environment variable to ` true ` by editing the ` MyCloudFunction ` scheme Run/Arguments options.
24
24
* Hit ` Run `
25
25
* Once it is up you should see a log message in the Xcode console saying
26
- ` LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke`
26
+ ` LocalSCFServer started and listening on 127.0.0.1:7000, receiving events on /invoke`
27
27
which means the local emulator is up and receiving traffic on port ` 7000 ` and expecting events on the ` /invoke ` endpoint.
28
28
29
29
Continue to run the ` MyApp ` target
@@ -32,4 +32,4 @@ Continue to run the `MyApp` target
32
32
* Once up, the application's UI should appear in the simulator allowing you
33
33
to interact with it.
34
34
35
- Once both targets are running, set up breakpoints in the iOS application or Lambda function to observe the system behavior.
35
+ Once both targets are running, set up breakpoints in the iOS application or cloud function to observe the system behavior.
0 commit comments