代碼: https://github.com/ikuokuo/start-serverless
産品頁開通服務。使用流程,如下:

新手示例,如下:
阿裡雲提供了如下幾種方式建立函數:
使用控制台建立函數
使用Funcraft建立函數
使用VSCode插件建立函數
以下為使用 VSCode 插件建立函數。
Visual Studio Code
Docker
插件: Aliyun Serverless VSCode Extension
VSCode 插件市場搜尋 "aliyun" ,安裝:
左側邊欄,打開插件,綁定賬戶:
依次輸入 Account ID, AccessKey ID, AccessKey Secret, Account Alias 。
綁定後, "REMOTE RESOURCES" 可以看到該賬戶的雲端服務與函數清單。
"LOCAL RESOURCES" 面闆 "+" 建立函數:
輸入内容:
函數名稱上 "Local Run" 運作:
函數日志,輸出在終端。
"LOCAL RESOURCES" 面闆 "Deploy" 部署函數:
"REMOTE RESOURCES" 可檢視部署的函數。
或者到阿裡雲函數計算控制台檢視:
Funcraft 是函數計算提供的一種指令行工具,通過該工具,您可以便捷地管理函數計算、API網關、日志服務等資源。通過一個資源配置檔案 template.yml , Funcraft 即可協助您進行開發、建構、部署操作。
<code>npm</code> 安裝:
<code>fun</code> 版本:
<code>fun</code> 配置:
運作:
效果:
初始化:
删除 <code>index.js</code>。
修改 <code>template.yml</code>:
建立 <code>bootstrap</code>:
Something is already running on port: https://github.com/facebook/docusaurus/issues/3505. Check <code>npx docusaurus --version</code> >= 2.0.0-alpha.66 !
編譯:
部署:
通路 http://33146085-1117460590419785.test.functioncompute.com:
歡迎關注 GoCoding 公衆号,分享日常 Coding 中實用的小技巧、小知識!