{"id":116311,"date":"2026-10-21T06:08:49","date_gmt":"2026-10-20T22:08:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/116311.html"},"modified":"2026-10-21T06:08:49","modified_gmt":"2026-10-20T22:08:49","slug":"wing-%e6%b5%8b%e8%af%95%e5%bf%ab%e7%85%a7%e6%b7%b1%e5%ba%a6%e8%a7%a3%e6%9e%90%ef%bc%9acloud-service-%e7%94%9f%e5%91%bd%e5%91%a8%e6%9c%9f%e9%a9%b1%e5%8a%a8%e7%9a%84-http-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/116311.html","title":{"rendered":"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u8bed\u8a00\u8fd0\u884c\u65f6<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011wing<\/h3>\n<p class=\"gcb-project-desc\">A programming language for the cloud \u2601\ufe0f A unified programming model, combining infrastructure and runtime code into one language \u26a1<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/wi\/wing<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h3>\u5bfc\u8bfb<\/h3>\n<p>\u672c\u6587\u4ee5\u4ed3\u5e93\u4e2d http-server.test.w_compile_tf-aws.md \u8fd9\u4e00 hangar \u6d4b\u8bd5\u5feb\u7167\u4e3a\u8d77\u70b9&#xff0c;\u5b8c\u6574\u8fd8\u539f Wing \u8bed\u8a00\u4e2d cloud.Service&#xff08;\u4e91\u670d\u52a1\u751f\u547d\u5468\u671f\u62bd\u8c61&#xff09;\u4e0e HTTP \u670d\u52a1\u5668\u8054\u52a8\u7684\u6d4b\u8bd5\u7528\u4f8b&#xff1a;\u4ece\u5feb\u7167\u6587\u4ef6\u672c\u8eab\u7684\u5185\u5bb9\u7ed3\u6784\u3001\u88ab\u6d4b\u6e90\u7801 http-server.test.w \u7684\u5199\u6cd5&#xff0c;\u5230 extern \u6865\u63a5\u7684 JavaScript \u5b9e\u73b0\u3001SDK \u5e95\u5c42 Service \u7c7b\u7684\u8bed\u4e49\u8bbe\u8ba1&#xff0c;\u4ee5\u53ca sim \u4e0e tf-aws \u4e24\u4e2a\u7f16\u8bd1\u76ee\u6807\u4e3a\u4f55\u4ea7\u751f\u622a\u7136\u4e0d\u540c\u7684\u4ea7\u7269\u3002\u8bfb\u5b8c\u672c\u6587&#xff0c;\u4f60\u5c06\u80fd\u8bfb\u61c2 Wing \u6d4b\u8bd5\u5feb\u7167\u7684\u751f\u6210\u4e0e\u547d\u540d\u89c4\u5219&#xff0c;\u638c\u63e1 cloud.Service \u7684 start\/stop \u751f\u547d\u5468\u671f\u7f16\u7a0b\u6a21\u578b&#xff0c;\u5e76\u7406\u89e3\u76ee\u6807\u5e73\u53f0\u6761\u4ef6\u7f16\u8bd1&#xff08;&#064;target &#061;&#061; &#034;sim&#034;&#xff09;\u5982\u4f55\u5f71\u54cd\u6700\u7ec8 Terraform \u4ea7\u7269\u3002<\/p>\n<h3>\u5feb\u7167\u6587\u4ef6\u662f\u4ec0\u4e48&#xff1a;hangar \u6d4b\u8bd5\u5feb\u7167\u4f53\u7cfb<\/h3>\n<p>\u8be5\u6587\u6863\u4f4d\u4e8e tools\/hangar\/snapshots\/test_corpus\/sdk_tests\/service\/ \u76ee\u5f55\u4e0b&#xff0c;\u662f Wing \u4ed3\u5e93\u4e2d hangar&#xff08;\u6d4b\u8bd5\u6302\u67b6&#xff09;\u5de5\u5177\u81ea\u52a8\u751f\u6210\u7684\u5feb\u7167\u6587\u4ef6\u3002\u5176\u547d\u540d\u9075\u5faa tools\/hangar\/src\/utils.ts \u4e2d createMarkdownSnapshot \u7684\u5b9a\u4e49&#xff1a;<\/p>\n<p>const snapPath &#061; join(<br \/>\n  snapshotDir,<br \/>\n  &#034;test_corpus&#034;,<br \/>\n  dirname(relativePath),<br \/>\n  &#096;${wingFile}_${testCase}_${target}.md&#096;<br \/>\n);<\/p>\n<p>\u5373 \u6587\u4ef6\u540d_\u6d4b\u8bd5\u7c7b\u578b_\u7f16\u8bd1\u76ee\u6807.md\u3002\u56e0\u6b64&#xff1a;<\/p>\n<ul>\n<li>http-server.test.w_compile_tf-aws.md \u8868\u793a\u6e90\u6587\u4ef6 http-server.test.w \u4ee5 compile&#xff08;\u4ec5\u7f16\u8bd1&#xff09; \u65b9\u5f0f\u5728 tf-aws \u76ee\u6807\u4e0b\u7684\u4ea7\u7269\u5feb\u7167&#xff1b;<\/li>\n<li>\u540c\u76ee\u5f55\u8fd8\u5b58\u5728 http-server.test.w_test_sim.md&#xff0c;\u8868\u793a\u540c\u4e00\u6e90\u6587\u4ef6\u4ee5 test&#xff08;\u8fd0\u884c\u6d4b\u8bd5&#xff09; \u65b9\u5f0f\u5728 sim \u76ee\u6807\u4e0b\u7684\u8fd0\u884c\u5feb\u7167\u3002<\/li>\n<\/ul>\n<p>\u5feb\u7167\u5934\u90e8 # [http-server.test.w](https:\/\/link.gitcode.com\/i\/8a3797bde0d0904e00743a889de82039) | compile | tf-aws \u4e2d\u7684\u76f8\u5bf9\u94fe\u63a5\u6307\u5411\u88ab\u6d4b\u6e90\u6587\u4ef6 tests\/sdk_tests\/service\/http-server.test.w&#xff0c;\u8fd9\u662f hangar \u81ea\u52a8\u8ba1\u7b97\u51fa\u7684\u4ece\u5feb\u7167\u76ee\u5f55\u5230\u6d4b\u8bd5\u76ee\u5f55\u7684\u76f8\u5bf9\u8def\u5f84\u3002<\/p>\n<h3>\u5feb\u7167\u5185\u5bb9\u9010\u5b57\u6bb5\u89e3\u8bfb&#xff1a;main.tf.json<\/h3>\n<p>\u5feb\u7167\u6b63\u6587\u53ea\u6709\u4e00\u4e2a\u6587\u4ef6\u6bb5\u843d ## main.tf.json&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff08;\u4e0e\u5feb\u7167\u4e00\u81f4&#xff09;&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;\/\/&#034;: {<br \/>\n    &#034;metadata&#034;: {<br \/>\n      &#034;backend&#034;: &#034;local&#034;,<br \/>\n      &#034;stackName&#034;: &#034;root&#034;<br \/>\n    },<br \/>\n    &#034;outputs&#034;: {}<br \/>\n  },<br \/>\n  &#034;provider&#034;: {<br \/>\n    &#034;aws&#034;: [<br \/>\n      {}<br \/>\n    ]<br \/>\n  }<br \/>\n}<\/p>\n<p>\u9010\u5b57\u6bb5\u89e3\u8bfb&#xff1a;<\/p>\n<ul>\n<li>\/\/.metadata.backend &#061; &#034;local&#034;&#xff1a;Terraform \u540e\u7aef\u4e3a\u672c\u5730\u72b6\u6001&#xff08;local backend&#xff09;&#xff0c;\u5373\u4e0d\u914d\u7f6e\u8fdc\u7a0b state \u5b58\u50a8&#xff1b;<\/li>\n<li>\/\/.metadata.stackName &#061; &#034;root&#034;&#xff1a;Wing \u5e94\u7528\u6839\u6784\u9020&#xff08;root stack&#xff09;\u7684\u6808\u540d&#xff0c;\u4e0e packages\/&#064;winglang\/sdk\/src\/target-tf-aws\/app.ts \u4e2d\u6808\u7684\u7ec4\u7ec7\u65b9\u5f0f\u5bf9\u5e94&#xff1b;<\/li>\n<li>\/\/.outputs &#061; {}&#xff1a;\u8be5\u7f16\u8bd1\u4ea7\u7269\u6ca1\u6709\u5bfc\u51fa\u4efb\u4f55 Terraform output&#xff1b;<\/li>\n<li>provider.aws&#xff1a;\u58f0\u660e\u4e86 AWS provider&#xff0c;\u914d\u7f6e\u4e3a\u7a7a\u5bf9\u8c61 {}&#xff0c;\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u51ed\u8bc1\u4e0e\u533a\u57df\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4efd main.tf.json \u662f\u6574\u4e2a tf-aws \u7f16\u8bd1\u4ea7\u7269\u4e2d\u552f\u4e00\u751f\u6210\u7684\u6587\u4ef6\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u628a http-server.test.w \u7f16\u8bd1\u5230 tf-aws \u76ee\u6807\u65f6&#xff0c;Wing \u53ea\u4f1a\u4ea7\u51fa\u4e00\u4e2a\u58f0\u660e\u4e86 AWS provider \u7684\u7a7a\u9aa8\u67b6\u2014\u2014\u8fd9\u6b63\u662f\u4e0b\u4e00\u8282\u8981\u89e3\u91ca\u7684\u5173\u952e\u70b9\u3002<\/p>\n<h3>\u88ab\u6d4b\u6e90\u7801&#xff1a;http-server.test.w \u5b8c\u6574\u89e3\u8bfb<\/h3>\n<p>\u88ab\u6d4b\u6e90\u6587\u4ef6 tests\/sdk_tests\/service\/http-server.test.w \u5b8c\u6574\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>bring cloud;<br \/>\nbring http;<\/p>\n<p>struct Address {<br \/>\n  port: num;<br \/>\n}<\/p>\n<p>inflight interface IHttpServer {<br \/>\n  address(): Address;<br \/>\n  close(): void;<br \/>\n}<\/p>\n<p>\/\/ only supported in the &#034;sim&#034; target for now<br \/>\nif &#064;target &#061;&#061; &#034;sim&#034; {<br \/>\n  class MyService {<br \/>\n    b: cloud.Bucket;<br \/>\n    body: str;<\/p>\n<p>    pub s: cloud.Service;<\/p>\n<p>    new(body: str) {<br \/>\n      this.b &#061; new cloud.Bucket();<br \/>\n      this.body &#061; body;<\/p>\n<p>      this.s &#061; new cloud.Service(inflight () &#061;&gt; {<br \/>\n        log(&#034;starting service&#034;);<br \/>\n        let server &#061; MyService.createServer(this.body);<br \/>\n        let port &#061; server.address().port;<br \/>\n        log(&#034;listening on port {port}&#034;);<br \/>\n        this.b.put(&#034;port&#034;, &#034;{port}&#034;);<\/p>\n<p>        return () &#061;&gt; {<br \/>\n          log(&#034;closing server&#8230;&#034;);<br \/>\n          server.close();<br \/>\n        };<br \/>\n      });<br \/>\n    }<\/p>\n<p>    pub inflight port(): num {<br \/>\n      return num.fromStr(this.b.get(&#034;port&#034;));<br \/>\n    }<\/p>\n<p>    extern &#034;.\/http-server.js&#034; static inflight createServer(body: str): IHttpServer;<br \/>\n  }<\/p>\n<p>  let foo &#061; new MyService(&#034;bang bang!&#034;);<\/p>\n<p>  test &#034;http server is started with the service&#034; {<br \/>\n    let response &#061; http.get(&#034;http:\/\/localhost:{foo.port()}&#034;);<br \/>\n    log(response.body);<br \/>\n    assert(response.body &#061;&#061; &#034;bang bang!&#034;);<br \/>\n  }<\/p>\n<p>  test &#034;service.stop() closes the http server&#034; {<br \/>\n    let before &#061; http.get(&#034;http:\/\/localhost:{foo.port()}&#034;);<br \/>\n    assert(before.ok);<\/p>\n<p>    foo.s.stop();<\/p>\n<p>    \/\/ now the http server is expected to be closed<br \/>\n    let var error &#061; false;<br \/>\n    try {<br \/>\n      http.get(&#034;http:\/\/localhost:{foo.port()}&#034;);<br \/>\n    } catch {<br \/>\n      error &#061; true;<br \/>\n    }<br \/>\n    assert(error);<br \/>\n  }<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u6d4b\u8bd5\u7684\u6838\u5fc3\u8bbe\u8ba1\u503c\u5f97\u9010\u4e00\u62c6\u89e3&#xff1a;<\/p>\n<li>\n<p>\u76ee\u6807\u5e73\u53f0\u5b88\u536b&#xff1a;if &#064;target &#061;&#061; &#034;sim&#034; \u662f Wing \u5185\u5efa\u7684\u76ee\u6807\u5e73\u53f0\u6761\u4ef6\u7f16\u8bd1\u5b8f\u3002\u6574\u4e2a\u6d4b\u8bd5\u4f53&#xff08;MyService \u7c7b\u4e0e\u4e24\u4e2a test&#xff09;\u90fd\u88ab\u5305\u88f9\u5728\u5176\u4e2d&#xff0c;\u6ce8\u91ca\u4e5f\u660e\u786e\u5199\u7740 only supported in the &#034;sim&#034; target for now&#xff08;\u76ee\u524d\u4ec5\u5728 sim \u76ee\u6807\u4e0b\u652f\u6301&#xff09;\u3002\u8fd9\u6b63\u662f tf-aws \u7f16\u8bd1\u5feb\u7167\u4e2d\u6ca1\u6709\u4efb\u4f55\u4e1a\u52a1\u8d44\u6e90&#xff08;Bucket\u3001Service \u7b49&#xff09;\u7684\u6839\u672c\u539f\u56e0\u2014\u2014\u6761\u4ef6\u4e3a\u5047\u65f6\u6574\u6bb5\u4ee3\u7801\u4e0d\u4f1a\u8fdb\u5165\u7f16\u8bd1\u4ea7\u7269\u3002<\/p>\n<\/li>\n<li>\n<p>inflight interface IHttpServer&#xff1a;\u5b9a\u4e49\u4e86\u4e00\u4e2a\u8fd0\u884c\u671f&#xff08;inflight&#xff09;\u63a5\u53e3&#xff0c;\u5305\u542b address() \u4e0e close() \u4e24\u4e2a\u5f02\u6b65\u65b9\u6cd5&#xff0c;\u7528\u4e8e\u62bd\u8c61\u5916\u90e8 JavaScript \u6a21\u5757\u8fd4\u56de\u7684\u670d\u52a1\u5668\u53e5\u67c4\u3002<\/p>\n<\/li>\n<li>\n<p>MyService \u7c7b&#xff1a;\u5c01\u88c5\u4e86\u4e00\u4e2a cloud.Service \u4e0e\u4e00\u4e2a cloud.Bucket\u3002Service \u7684 handler&#xff08;inflight \u95ed\u5305&#xff09;\u8d1f\u8d23&#xff1a;\u542f\u52a8\u65f6\u6253\u5370\u65e5\u5fd7\u3001\u901a\u8fc7 extern \u7684 createServer \u521b\u5efa HTTP \u670d\u52a1\u5668\u3001\u8bfb\u53d6\u7aef\u53e3\u53f7\u5e76\u5199\u5165 Bucket&#xff1b;\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u6e05\u7406\u95ed\u5305&#xff0c;\u5728\u670d\u52a1\u505c\u6b62\u65f6\u88ab\u8c03\u7528&#xff0c;\u7528\u4e8e\u5173\u95ed\u670d\u52a1\u5668\u3002<\/p>\n<\/li>\n<li>\n<p>pub inflight port(): num&#xff1a;\u901a\u8fc7 num.fromStr(this.b.get(&#034;port&#034;)) \u4ece Bucket \u4e2d\u8bfb\u56de\u7aef\u53e3\u53f7&#xff0c;\u4f9b\u6d4b\u8bd5\u53d1\u8d77 HTTP \u8bf7\u6c42\u4f7f\u7528\u2014\u2014\u8fd9\u662f\u7528\u5171\u4eab Bucket \u5728\u670d\u52a1 handler \u4e0e\u5916\u90e8\u6d4b\u8bd5\u4ee3\u7801\u4e4b\u95f4\u4f20\u9012\u8fd0\u884c\u671f\u6570\u636e\u7684\u5178\u578b\u624b\u6cd5\u3002<\/p>\n<\/li>\n<li>\n<p>extern \u9759\u6001 inflight \u65b9\u6cd5&#xff1a;extern &#034;.\/http-server.js&#034; static inflight createServer(body: str): IHttpServer; \u58f0\u660e\u5c06\u65b9\u6cd5\u5b9e\u73b0\u59d4\u6258\u7ed9\u540c\u76ee\u5f55\u4e0b\u7684 http-server.js&#xff0c;\u8fd9\u662f Wing \u7684 extern \u5916\u90e8\u51fd\u6570\u6865\u63a5\u673a\u5236\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e24\u4e2a\u6d4b\u8bd5\u7528\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\u7b2c\u4e00\u4e2a\u6d4b\u8bd5\u9a8c\u8bc1&#034;\u670d\u52a1\u542f\u52a8\u540e HTTP \u670d\u52a1\u5668\u968f\u4e4b\u53ef\u7528&#034;&#xff1a;\u8bf7\u6c42 http:\/\/localhost:{foo.port()}&#xff0c;\u65ad\u8a00\u54cd\u5e94\u4f53\u7b49\u4e8e &#034;bang bang!&#034;&#xff08;\u5373\u6784\u9020\u65f6\u4f20\u5165\u7684 body&#xff09;&#xff1b;<\/li>\n<li>\u7b2c\u4e8c\u4e2a\u6d4b\u8bd5\u9a8c\u8bc1\u751f\u547d\u5468\u671f\u63a7\u5236&#xff1a;\u5148\u786e\u8ba4\u670d\u52a1\u5668\u53ef\u8bbf\u95ee&#xff0c;\u968f\u540e\u8c03\u7528 foo.s.stop() \u505c\u6b62\u670d\u52a1&#xff0c;\u518d\u53d1\u8d77\u8bf7\u6c42\u5e76\u65ad\u8a00\u629b\u9519&#xff0c;\u8bc1\u660e\u670d\u52a1\u5668\u5df2\u88ab\u5173\u95ed\u3002<\/li>\n<\/ul>\n<\/li>\n<h3>\u4e3a\u4ec0\u4e48 tf-aws \u7f16\u8bd1\u4ea7\u7269\u5982\u6b64\u7cbe\u7b80<\/h3>\n<p>\u4ece\u5feb\u7167\u672c\u8eab\u770b&#xff0c;tf-aws \u4ea7\u7269\u53ea\u6709 provider \u58f0\u660e&#xff1b;\u8fd9\u5e76\u975e\u7f16\u8bd1\u5668\u6545\u969c&#xff0c;\u800c\u662f\u6d4b\u8bd5\u4ee3\u7801\u88ab\u76ee\u6807\u5e73\u53f0\u6761\u4ef6\u5b88\u536b\u9694\u79bb\u7684\u5fc5\u7136\u7ed3\u679c\u3002\u53ef\u4ee5\u4ece\u4ed3\u5e93\u6e90\u7801\u5f97\u5230\u4f50\u8bc1&#xff1a;<\/p>\n<ul>\n<li>\u5728 packages\/&#064;winglang\/sdk\/src\/target-tf-aws\/service.ts \u4e2d&#xff0c;cloud.Service \u5728 AWS \u76ee\u6807\u7684\u5b9e\u73b0\u4f1a\u771f\u5b9e\u751f\u6210\u4e00\u6574\u5957\u57fa\u7840\u8bbe\u65bd\u8d44\u6e90&#xff1a;EcsCluster\u3001EcsService&#xff08;FARGATE \u542f\u52a8\u7c7b\u578b&#xff09;\u3001EcsTaskDefinition\u3001IamRole\u3001SecurityGroup\u3001CloudWatch \u65e5\u5fd7\u7ec4\u3001Docker \u955c\u50cf\u4e0e ECR \u4ed3\u5e93\u7b49\u3002\u82e5 http-server.test.w \u53bb\u6389 &#064;target \u5b88\u536b&#xff0c;tf-aws \u5feb\u7167\u7edd\u4e0d\u53ef\u80fd\u53ea\u6709 20 \u884c\u2014\u2014\u8fd9\u4e00\u70b9\u53cd\u8fc7\u6765\u5370\u8bc1\u4e86\u5feb\u7167\u7684&#034;\u7cbe\u7b80&#034;\u6b63\u662f\u6761\u4ef6\u7f16\u8bd1\u751f\u6548\u7684\u8bc1\u636e\u3002<\/li>\n<li>\u53e6\u5916 tools\/hangar\/src\/utils.ts \u663e\u793a&#xff0c;\u5feb\u7167\u5728\u5199\u5165\u524d\u4f1a\u7ecf\u8fc7\u6e05\u7406&#xff1a;\u5220\u9664 terraform \u5b57\u6bb5\u4e0e cdktf \u7248\u672c\u4fe1\u606f&#xff08;delete finalObj.terraform\u3001delete finalObj[&#034;\/\/&#034;][&#034;metadata&#034;][&#034;version&#034;]&#xff09;&#xff0c;\u56e0\u6b64\u5feb\u7167\u5c55\u793a\u7684\u662f&#034;\u4e1a\u52a1\u76f8\u5173&#034;\u7684 Terraform \u5185\u5bb9\u3002<\/li>\n<\/ul>\n<h3>extern \u6865\u63a5&#xff1a;http-server.js \u4e0e extern.d.ts<\/h3>\n<p>\u88ab\u6d4b\u6d4b\u8bd5\u4f9d\u8d56 tests\/sdk_tests\/service\/http-server.js \u63d0\u4f9b\u771f\u5b9e HTTP \u670d\u52a1\u5668\u5b9e\u73b0&#xff1a;<\/p>\n<p>const http &#061; require(&#034;http&#034;);<\/p>\n<p>exports.createServer &#061; async function(body) {<br \/>\n  return new Promise((resolve, reject) &#061;&gt; {<br \/>\n    const server &#061; http.createServer();<br \/>\n    server.on(&#034;request&#034;, (_, res) &#061;&gt; res.end(body));<br \/>\n    server.on(&#034;error&#034;, reject);<br \/>\n    server.on(&#034;listening&#034;, () &#061;&gt; resolve({<br \/>\n      address: () &#061;&gt; server.address(),<br \/>\n      close: () &#061;&gt; new Promise((resolve) &#061;&gt; server.close(resolve)),<br \/>\n    }));<br \/>\n    server.listen();<br \/>\n  });<br \/>\n};<\/p>\n<p>\u8981\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u4f7f\u7528 Node.js \u539f\u751f http \u6a21\u5757&#xff0c;\u76d1\u542c\u968f\u673a\u7aef\u53e3&#xff08;server.listen() \u4e0d\u4f20\u7aef\u53e3&#xff09;&#xff1b;<\/li>\n<li>request \u4e8b\u4ef6\u4e2d\u76f4\u63a5\u5c06 body \u4f5c\u4e3a\u54cd\u5e94\u4f53\u8fd4\u56de&#xff0c;\u8fd9\u89e3\u91ca\u4e86\u6d4b\u8bd5\u65ad\u8a00 response.body &#061;&#061; &#034;bang bang!&#034;&#xff1b;<\/li>\n<li>\u8fd4\u56de\u5bf9\u8c61\u66b4\u9732 address()&#xff08;\u8fd4\u56de server.address()&#xff0c;\u5185\u542b port&#xff09;\u4e0e close()&#xff08;Promise \u5316\u7684 server.close&#xff09;&#xff0c;\u4e0e Wing \u4fa7\u7684 inflight interface IHttpServer \u4e00\u4e00\u5bf9\u5e94\u3002<\/li>\n<\/ul>\n<p>\u540c\u76ee\u5f55\u7684 http-server.extern.d.ts \u662f\u8be5 extern \u7684\u7c7b\u578b\u58f0\u660e&#xff0c;\u660e\u786e\u5b9a\u4e49\u4e86 createServer: (body: string) &#061;&gt; Promise&lt;IHttpServer$Inflight&gt;\u3001Address.port: number \u4ee5\u53ca IHttpServer$Inflight \u7684 address\/close \u7b7e\u540d\u2014\u2014Wing \u7f16\u8bd1\u5668\u636e\u6b64\u5b8c\u6210\u7c7b\u578b\u68c0\u67e5\u4e0e inflight \u5ba2\u6237\u7aef\u751f\u6210\u3002<\/p>\n<h3>cloud.Service \u7684 SDK \u8bed\u4e49\u4e0e\u5b9e\u73b0\u539f\u7406<\/h3>\n<p>\u4ece packages\/&#064;winglang\/sdk\/src\/cloud\/service.ts \u53ef\u4ee5\u5b8c\u6574\u8fd8\u539f cloud.Service \u7684\u8bbe\u8ba1&#xff1a;<\/p>\n<ul>\n<li>\u751f\u547d\u5468\u671f\u4e09\u65b9\u6cd5&#xff1a;ServiceInflightMethods \u679a\u4e3e\u4e86 START\u3001STOP\u3001STARTED&#xff0c;\u5bf9\u5e94 inflight \u5ba2\u6237\u7aef IServiceClient \u7684 start()\u3001stop()\u3001started() \u4e09\u4e2a\u5f02\u6b65\u65b9\u6cd5&#xff08;service.ts&#xff09;&#xff1b;<\/li>\n<li>\u6784\u9020\u53c2\u6570&#xff1a;ServiceProps \u652f\u6301 env&#xff08;\u73af\u5883\u53d8\u91cf&#xff09;\u4e0e autoStart&#xff08;\u662f\u5426\u81ea\u52a8\u542f\u52a8&#xff0c;\u9ed8\u8ba4 true&#xff0c;service.ts&#xff09;&#xff1b;<\/li>\n<li>handler \u4e0e\u6e05\u7406\u95ed\u5305&#xff1a;IServiceHandlerClient.handle() \u8fd4\u56de IServiceStopHandler | undefined&#xff0c;\u5373\u670d\u52a1\u505c\u6b62\u65f6\u6267\u884c\u7684\u53ef\u9009\u6e05\u7406\u95ed\u5305&#xff08;service.ts&#xff09;&#xff1b;<\/li>\n<li>entrypoint \u751f\u6210&#xff1a;_preSynthesize() \u4f1a\u57fa\u4e8e handler \u751f\u6210\u4e00\u6bb5 Node \u4ee3\u7801\u5e76\u5199\u5165 &lt;assetName&gt;.cjs \u5165\u53e3\u6587\u4ef6&#xff08;service.ts&#xff09;&#xff0c;\u5176\u4e2d start \u8c03\u7528 client.handle() \u62ff\u5230\u6e05\u7406\u51fd\u6570\u5e76\u6682\u5b58\u5230 $stop&#xff0c;stop \u5219\u8c03\u7528 $stop() \u5e76\u7f6e\u7a7a&#xff1b;\u82e5\u91cd\u590d start \u4f1a\u629b service already started&#xff0c;\u672a\u542f\u52a8\u5c31 stop \u4f1a\u629b service not started\u2014\u2014\u8fd9\u89e3\u91ca\u4e86\u6d4b\u8bd5\u4e2d&#034;\u5148 stop \u518d\u8bf7\u6c42\u5fc5\u5931\u8d25&#034;\u7684\u786e\u5b9a\u6027\u3002<\/li>\n<\/ul>\n<p>\u5728 sim \u76ee\u6807\u4e0b&#xff0c;packages\/&#064;winglang\/sdk\/src\/target-sim\/service.ts \u5c06\u670d\u52a1\u63cf\u8ff0\u4e3a&#034;\u5728 Node vm \u5185\u6d3e\u751f\u7684\u8fdb\u7a0b&#034;&#xff0c;\u901a\u8fc7 autoStart \u5c5e\u6027\u63a7\u5236\u662f\u5426\u968f\u5e94\u7528\u81ea\u52a8\u62c9\u8d77&#xff0c;\u4e0e\u5b98\u65b9\u6587\u6863 service.md \u4e2d&#034;sim \u76ee\u6807\u4e0b\u670d\u52a1\u53ea\u662f node vm \u4e2d\u7684\u8fdb\u7a0b&#034;\u7684\u63cf\u8ff0\u4e00\u81f4\u3002<\/p>\n<h3>sim \u76ee\u6807\u8fd0\u884c\u5feb\u7167&#xff1a;\u6d4b\u8bd5\u7ed3\u679c\u9a8c\u8bc1<\/h3>\n<p>\u540c\u76ee\u5f55\u7684 http-server.test.w_test_sim.md \u8bb0\u5f55\u4e86\u8be5\u6d4b\u8bd5\u5728 sim \u76ee\u6807\u4e0b\u7684\u771f\u5b9e\u8fd0\u884c\u8f93\u51fa&#xff1a;<\/p>\n<p>[INFO] http server is started with the service | starting service<br \/>\n[INFO] http server is started with the service | listening on port &lt;PORT&gt;<br \/>\n[INFO] http server is started with the service | bang bang!<br \/>\n[INFO] http server is started with the service | closing server&#8230;<br \/>\n[INFO] service.stop() closes the http server | starting service<br \/>\n[INFO] service.stop() closes the http server | listening on port &lt;PORT&gt;<br \/>\n[INFO] service.stop() closes the http server | closing server&#8230;<br \/>\npass \u2500 http-server.test.wsim \u00bb root\/Default\/test:http server is started with the service<br \/>\npass \u2500 http-server.test.wsim \u00bb root\/Default\/test:service.stop() closes the http server<\/p>\n<p>Tests 2 passed (2)<\/p>\n<p>\u8fd9\u4efd\u8fd0\u884c\u5feb\u7167\u4e0e tf-aws \u7f16\u8bd1\u5feb\u7167\u4e92\u4e3a\u955c\u50cf&#xff0c;\u5b8c\u6574\u5448\u73b0\u4e86\u5b8c\u6574\u751f\u547d\u5468\u671f&#xff1a;\u4e24\u4e2a\u6d4b\u8bd5\u5404\u81ea\u7ecf\u5386&#034;starting service \u2192 listening on port \u2192&#xff08;\u8bf7\u6c42\u6210\u529f\/\u5931\u8d25&#xff09;\u2192 closing server&#034;&#xff0c;\u6700\u7ec8 Tests 2 passed (2)\u3002\u5176\u4e2d &lt;PORT&gt;\u3001&lt;DURATION&gt; \u4e3a\u5feb\u7167\u89c4\u8303\u5316\u540e\u7684\u5360\u4f4d\u7b26&#xff08;\u968f\u673a\u7aef\u53e3\u4e0e\u8017\u65f6\u88ab\u62b9\u5e73\u4ee5\u4fdd\u8bc1\u5feb\u7167\u786e\u5b9a\u6027&#xff09;\u3002<\/p>\n<h3>AWS \u76ee\u6807\u7684\u5e95\u5c42\u5b9e\u73b0&#xff08;\u5ef6\u4f38\u9605\u8bfb&#xff09;<\/h3>\n<p>\u82e5\u53bb\u6389 &#064;target \u5b88\u536b&#xff0c;tf-aws \u76ee\u6807\u7684 cloud.Service \u4f1a\u771f\u5b9e\u843d\u5730\u4e3a ECS\/Fargate \u57fa\u7840\u8bbe\u65bd&#xff08;packages\/&#064;winglang\/sdk\/src\/target-tf-aws\/service.ts&#xff09;&#xff1a;<\/p>\n<ul>\n<li>inflight \u95ed\u5305\u88ab\u5c01\u88c5\u4e3a Dockerfile&#xff08;createServiceDockerfile&#xff09;\u5e76\u6784\u5efa\u3001\u63a8\u9001\u5230 ECR \u4ed3\u5e93&#xff1b;<\/li>\n<li>\u4efb\u52a1\u5b9a\u4e49\u4f7f\u7528 FARGATE \u517c\u5bb9\u6027\u3001memory: &#034;512&#034;\u3001cpu: &#034;256&#034;\u3001awsvpc \u7f51\u7edc\u6a21\u5f0f&#xff1b;<\/li>\n<li>\u9ed8\u8ba4\u521b\u5efa\u5b89\u5168\u7ec4&#xff08;\u5168\u653e\u901a egress\/ingress&#xff09;\u3001CloudWatch \u65e5\u5fd7\u7ec4&#xff08;\/ecs\/&lt;assetName&gt;&#xff0c;\u4fdd\u7559 7 \u5929&#xff09;\u4e0e\u6267\u884c\/\u4efb\u52a1 IAM \u89d2\u8272&#xff1b;<\/li>\n<li>\u8fd0\u884c\u671f start\/stop\/started \u7531 shared-aws\/service.inflight.ts \u4e2d\u7684 ServiceClient \u5b9e\u73b0&#xff1a;start \u901a\u8fc7 UpdateServiceCommand \u5c06 desiredCount \u7f6e\u4e3a 1&#xff0c;stop \u7f6e\u4e3a 0&#xff0c;started \u901a\u8fc7 DescribeServicesCommand \u5224\u65ad desiredCount &gt;&#061; 1\u2014\u2014\u8fd9\u4e0e SDK \u6587\u6863 service.md \u4e2d&#034;AWS \u4e0b\u4f7f\u7528 ECS &#043; FARGATE&#xff0c;\u672a\u6307\u5b9a VPC \u65f6\u521b\u5efa\u9ed8\u8ba4 VPC&#034;\u7684\u63cf\u8ff0\u76f8\u4e92\u5370\u8bc1\u3002<\/li>\n<\/ul>\n<h3>\u5982\u4f55\u590d\u73b0\u4e0e\u67e5\u770b<\/h3>\n<ul>\n<li>\u5feb\u7167\u4ec5\u7528\u4e8e\u5c55\u793a\u7f16\u8bd1\/\u8fd0\u884c\u7ed3\u679c&#xff0c;\u5c5e\u4e8e\u53ea\u8bfb\u6d4b\u8bd5\u4ea7\u7269&#xff1b;\u8981\u590d\u73b0\u5176\u751f\u6210\u8fc7\u7a0b&#xff0c;\u9700\u8981\u8fd0\u884c\u4ed3\u5e93\u7684 hangar \u6d4b\u8bd5\u5957\u4ef6&#xff08;tools\/hangar&#xff09;&#xff0c;\u5176\u5165\u53e3\u903b\u8f91\u4f4d\u4e8e tools\/hangar\/src\/generate_tests.ts&#xff1b;<\/li>\n<li>\u60f3\u8981\u52a8\u624b\u5b9e\u9a8c\u8fd9\u6bb5\u6d4b\u8bd5&#xff0c;\u53ef\u5c06 http-server.test.w \u4e0e\u540c\u76ee\u5f55\u7684 http-server.js\u3001http-server.extern.d.ts \u653e\u5728\u540c\u4e00\u76ee\u5f55&#xff0c;\u5e76\u5728 wing.toml \u4e2d\u5c06\u9ed8\u8ba4\u76ee\u6807\u914d\u7f6e\u4e3a sim \u540e\u8fd0\u884c wing test&#xff1b;\u6ce8\u610f\u8be5\u7528\u4f8b\u76ee\u524d\u4ec5\u652f\u6301 sim \u76ee\u6807&#xff0c;tf-aws \u76ee\u6807\u4e0b\u56e0 &#064;target \u5b88\u536b\u4e0d\u4f1a\u751f\u6210\u4e1a\u52a1\u8d44\u6e90&#xff1b;<\/li>\n<li>\u5982\u9700\u6df1\u5165\u4e86\u89e3 cloud.Service \u7684 API \u8bed\u4e49&#xff0c;\u53ef\u7ee7\u7eed\u9605\u8bfb SDK \u6587\u6863 service.md&#xff0c;\u5176\u4e2d\u6db5\u76d6\u4e86 autoStart: false \u7684\u624b\u52a8\u542f\u505c\u3001start\/stop \u5e42\u7b49\u6027&#xff08;\u91cd\u590d\u8c03\u7528\u65e0\u526f\u4f5c\u7528&#xff09;\u4ee5\u53ca\u8fd4\u56de\u6e05\u7406\u95ed\u5305\u4f20\u9012\u4e0a\u4e0b\u6587\u7684\u63a8\u8350\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<h3>\u5c0f\u7ed3<\/h3>\n<p>\u4e00\u4e2a\u770b\u4f3c\u53ea\u6709 20 \u884c\u7684 tf-aws \u7f16\u8bd1\u5feb\u7167&#xff0c;\u80cc\u540e\u4e32\u8054\u8d77\u4e86 Wing \u7684\u6574\u5957\u6d4b\u8bd5\u4e0e\u62bd\u8c61\u8bbe\u8ba1&#xff1a;hangar \u5feb\u7167\u547d\u540d\u7ea6\u5b9a\u3001&#064;target \u76ee\u6807\u5e73\u53f0\u6761\u4ef6\u7f16\u8bd1\u3001extern \u5916\u90e8\u4ee3\u7801\u6865\u63a5\u3001cloud.Service \u7684 start\/stop\/\u6e05\u7406\u95ed\u5305\u751f\u547d\u5468\u671f\u6a21\u578b&#xff0c;\u4ee5\u53ca sim&#xff08;Node vm \u8fdb\u7a0b&#xff09;\u4e0e AWS&#xff08;ECS\/Fargate &#043; ECR&#xff09;\u4e24\u79cd\u76ee\u6807\u5b9e\u73b0\u7684\u5de8\u5927\u5dee\u5f02\u3002\u8bfb\u61c2\u8fd9\u7c7b\u5feb\u7167&#xff0c;\u662f\u7406\u89e3 Wing \u7f16\u8bd1\u5668\u4ea7\u7269\u4e0e\u6807\u51c6\u5e93\u62bd\u8c61\u7684\u6700\u4f73\u5207\u5165\u70b9\u4e4b\u4e00\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020220848-6ad7e6708578e.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u8bed\u8a00\u8fd0\u884c\u65f6<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011wing<\/h3>\n<p class=\"gcb-project-desc\">A programming language for the cloud \u2601\ufe0f A unified programming model, combining infrastructure and runtime code into one language \u26a1<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/wi\/wing<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Wing \u5bb9\u5668 Entrypoint \u5feb\u7167\u6d4b\u8bd5\u89e3\u6790&#xff1a;\u4ece sim.Container \u53c2\u6570\u5230 tf-aws \u7f16\u8bd1\u4ea7\u7269<\/h5>\n<p class=\"gcb-related-item-desc\">Wing \u5bb9\u5668 Entrypoint \u5feb\u7167\u6d4b\u8bd5\u89e3\u6790&#xff1a;\u4ece sim.Container \u53c2\u6570\u5230 tf aws \u7f16\u8bd1\u4ea7\u7269 \u5bfc\u8bfb \u672c\u6587\u56f4\u7ed5 Wing \u4ed3\u5e93\u4e2d hanga<\/p>\n<p>     <span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><br \/>\n     <span class=\"gcb-tag\">\u8bed\u8a00\u8fd0\u884c\u65f6<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Wing \u7f16\u8bd1\u5668\u5feb\u7167\u5206\u6790&#xff1a;math.factorial \u6d4b\u8bd5\u5728 tf-aws \u5e73\u53f0\u4e0b\u7684\u7f16\u8bd1\u4ea7\u7269\u89e3\u8bfb<\/h5>\n<p class=\"gcb-related-item-desc\">Wing \u7f16\u8bd1\u5668\u5feb\u7167\u5206\u6790&#xff1a;math.factorial \u6d4b\u8bd5\u5728 tf aws \u5e73\u53f0\u4e0b\u7684\u7f16\u8bd1\u4ea7\u7269\u89e3\u8bfb \u672c\u6587\u4ee5 Wing \u5b98\u65b9\u4ed3\u5e93\u4e2d factorial.test.<\/p>\n<p>     <span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><br \/>\n     <span class=\"gcb-tag\">\u8bed\u8a00\u8fd0\u884c\u65f6<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Wing \u5feb\u7167\u6d4b\u8bd5\u6df1\u5ea6\u5256\u6790&#xff1a;empty-actions.test.w \u7f16\u8bd1\u5230 tf-aws \u5e73\u53f0\u7684 Terraform \u4ea7\u7269\u5168\u89e3\u8bfb<\/h5>\n<p class=\"gcb-related-item-desc\">Wing \u5feb\u7167\u6d4b\u8bd5\u6df1\u5ea6\u5256\u6790&#xff1a;empty actions.test.w \u7f16\u8bd1\u5230 tf aws \u5e73\u53f0\u7684 Terraform \u4ea7\u7269\u5168\u89e3\u8bfb \u672c\u7bc7\u6280\u672f\u6307\u5357\u56f4\u7ed5 Wing <\/p>\n<p>     <span class=\"gcb-tag\">\u7f16\u7a0b\u8bed\u8a00<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f16\u8bd1\u5668<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><br \/>\n     <span class=\"gcb-tag\">\u8bed\u8a00\u8fd0\u884c\u65f6<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  \u4e09\u6b65\u6784\u5efa\u4e13\u5c5e\u865a\u62df\u9a91\u884c\u8bad\u7ec3\u5ba4&#xff1a;\u544a\u522b\u7f51\u7edc\u4f9d\u8d56\u7684\u5168\u65b0\u4f53\u9a8c <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  YimMenu\u514d\u8d39GTA5\u8f85\u52a9\u5de5\u5177&#xff1a;\u65b0\u624b\u5feb\u901f\u4e0a\u624b\u7ec8\u6781\u6307\u5357 <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f16\u7a0b\u8bed\u8a00\u7f16\u8bd1\u5668\u4e91\u539f\u751f\u8bed\u8a00\u8fd0\u884c\u65f6 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011wing A programming language for the cloud \u2601\ufe0f A unified programming model, combining infrastructure and runtime code into one language \u26a1 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/wi\/wing \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u5bfc\u8bfb<br \/>\n\u672c\u6587\u4ee5\u4ed3\u5e93\u4e2d http-s<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-116311","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/116311.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7f16\u7a0b\u8bed\u8a00\u7f16\u8bd1\u5668\u4e91\u539f\u751f\u8bed\u8a00\u8fd0\u884c\u65f6 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011wing A programming language for the cloud \u2601\ufe0f A unified programming model, combining infrastructure and runtime code into one language \u26a1 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/wi\/wing \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u4ee5\u4ed3\u5e93\u4e2d http-s\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/116311.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-20T22:08:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020220848-6ad7e6708578e.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116311.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/116311.html\",\"name\":\"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-20T22:08:49+00:00\",\"dateModified\":\"2026-10-20T22:08:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/116311.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/116311.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116311.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/116311.html","og_locale":"zh_CN","og_type":"article","og_title":"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7f16\u7a0b\u8bed\u8a00\u7f16\u8bd1\u5668\u4e91\u539f\u751f\u8bed\u8a00\u8fd0\u884c\u65f6 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011wing A programming language for the cloud \u2601\ufe0f A unified programming model, combining infrastructure and runtime code into one language \u26a1 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/wi\/wing \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u4ee5\u4ed3\u5e93\u4e2d http-s","og_url":"https:\/\/www.wsisp.com\/helps\/116311.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-20T22:08:49+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020220848-6ad7e6708578e.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/116311.html","url":"https:\/\/www.wsisp.com\/helps\/116311.html","name":"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-20T22:08:49+00:00","dateModified":"2026-10-20T22:08:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/116311.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/116311.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/116311.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Wing \u6d4b\u8bd5\u5feb\u7167\u6df1\u5ea6\u89e3\u6790\uff1acloud.Service \u751f\u547d\u5468\u671f\u9a71\u52a8\u7684 HTTP \u670d\u52a1\u5668\uff08tf-aws \u7f16\u8bd1\u4ea7\u7269\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=116311"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116311\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=116311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=116311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=116311"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=116311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}