開發者:Serverless 從懵比到實戰

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Serverless 是一種執行模型"},{"type":"codeinline","content":[{"type":"text","text":"(execution model)"}]},{"type":"text","text":"。在這種模型中,雲服務商負責通過動態地分配資源來執行一段代碼。雲服務商僅僅收取執行這段代碼所需要資源的費用。代碼通常會被運行在一個無狀態的容器內,並且可被多種事件觸發("},{"type":"codeinline","content":[{"type":"text","text":"http 請求"}]},{"type":"text","text":"、數據庫事件、監控報警、文件上傳、定時任務……)。代碼常常會以函數"},{"type":"codeinline","content":[{"type":"text","text":"(function)"}]},{"type":"text","text":"的形式被上傳到雲服務商以供執行,因此"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"也會被稱作"},{"type":"codeinline","content":[{"type":"text","text":"Functions as a Service"}]},{"type":"text","text":" 或者 "},{"type":"codeinline","content":[{"type":"text","text":"FaaS"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"BaaS"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":": "},{"type":"codeinline","content":[{"type":"text","text":"Backend as a Service"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":",這裏的"},{"type":"codeinline","content":[{"type":"text","text":"Backend"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":"可以指代任何第三方提供的應用和服務,比如提供雲數據庫服務的"},{"type":"codeinline","content":[{"type":"text","text":"Firebase"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":"和"},{"type":"codeinline","content":[{"type":"text","text":"Parse"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":",提供統一用戶身份驗證服務的"},{"type":"codeinline","content":[{"type":"text","text":"Auth0"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":"和"},{"type":"codeinline","content":[{"type":"text","text":"Amazon Cognito"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":"等。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"FaaS"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":": "},{"type":"codeinline","content":[{"type":"text","text":"Functions as a Service"}],"marks":[{"type":"strong"}]},{"type":"text","marks":[{"type":"strong"}],"text":",應用以函數的形式存在,並由第三方雲平臺託管運行,比如騰訊云云函數 SCF、AWS Lambda 等。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"背景"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那麼我們爲什麼需要"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"呢?對於這個問題來說,我們可以從日常個人的開發中找到原因。無論是個人博客、小程序,還是個人網站,我們都要面臨一個問題:怎麼解決服務器部署相關的問題。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"對於常規的項目來說,一般的流程莫過於:購買服務器 => 域名備案(這一步可能可以不用,看個人需求) => 環境搭建 => 部署"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那麼我們如果僅僅是想要開發一個幾乎不太需要多強的後臺支持時,卻要去做這麼多操作,這對於整個項目的開發來說是十分不友好的,很容易就會讓人放棄上線的念頭。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那麼"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"就是用於解決這個問題的存在,他具備託管服務端各項功能的能力,讓你無需進行上述繁瑣的步驟就能輕鬆讓你的網站或服務正常運行且可訪問,同時能夠極大降低個人的維護成本,這對於廣大開發者而言無疑是十分實用的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"Serverless特點"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"1. 低成本"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"衆所周知,我們購買一個雲服務器,拋去人力成本不計,單從收費方式上來分析,各廠商都是採用按月計費的方式來收取,也就是即使沒有人訪問你的網站或服務,每月需要支付的租金都是不變的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"然後再來看"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"應用,它是按你實際使用的資源量來進行計價的,可以理解爲你用多少付多少,可以類比於我們手機流量的方式來收取。同時,根據福布斯2015年發佈的一份研究報告,從全年來看,一個典型的數據中心裏的服務器平均資源使用率只有可憐的 5%~15%,也就是說如果全部使用"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":",理論上至少可以節省80%的運行成本。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"對比分析之後,"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":" 在成本方面無疑是較低的。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"2. 自動擴縮容"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"正如上文所述,函數即應用,每一個函數只會服務於特定的功能,它可以隨意的進行動態拓展或者收縮容量,同時不會影響到其他函數,並且粒度更小,速度更快。反觀我們的單體應用和微服務來說,藉助於各種容器編排技術,雖然也能實現自動擴縮容,但由於粒度關係,相比函數,始終會存在一定的資源浪費。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"3. 事件驅動"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"函數本質上實現的是一種 IPO"},{"type":"codeinline","content":[{"type":"text","text":"(Input-Process-Output)"}]},{"type":"text","text":"模型,它是短暫的,是即用即走的。這點是函數區別於單體應用和微服務的另一個特徵。不管是單體應用,還是微服務,都是系統中的常駐進程,即便你不使用,它依舊會一直運行。而對於函數來說,沒有請求就不需要消耗任何資源,只有在收到請求時纔會調動資源進行響應,完成之後就會立刻釋放資源,這在節省資源方面無疑是巨大的優點。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"4. 無狀態"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從事件驅動能力中我們提到了它只有在收到請求時纔會工作起來,工作完成之後就立刻被釋放,也就是各種運行時的內存緩存都是沒有太大效益的,不僅如此,同一個請求方式,第二次訪問服務時很有可能被調度到其他新的機器上,所以本地緩存方式依舊是失效的,函數只能使用外存(比如"},{"type":"codeinline","content":[{"type":"text","text":"Redis"}]},{"type":"text","text":",數據庫)進行緩存,而操作外存都需要通過網絡,性能跟內存、本地硬盤相比差了一到兩個數量級。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"第一個雲函數"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這裏將利用騰訊雲作爲演示平臺,首先你需要先登錄到騰訊雲。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"接着打開雲函數控制檯:"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/52\/523573f16134365c4876accd8b13edd2.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"騰訊雲函數控制檯"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我們選擇新建一個雲函數,在這裏我們可以自由選擇開發的語言以及是否需要模板,爲了演示方便還是選擇勾選模板,然後點擊完成,就能進入我們正式的代碼編寫環節了。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/8c\/8c28f2e611a56e6b4ffcc3539eabd457.webp","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"代碼工作臺"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這裏我們可以隨意的修改函數的返回值,接着就能對它進行測試啦。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/15\/153e73c1ae72ebab974e2d7e1bf11ffe.webp","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"測試雲函數"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當你看到運行後的返回結果和你編寫的代碼返回值一致時就說明你的雲函數已經在工作中了。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當然,僅僅只是這麼測試一下自然很不過癮,我還想能通過"},{"type":"codeinline","content":[{"type":"text","text":"http"}]},{"type":"text","text":"請求的方式來訪問這個雲函數,又該怎麼做呢?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個其實也很簡單,我們選擇左側的觸發管理,新建一個觸發策略,並選擇觸發方式爲"},{"type":"codeinline","content":[{"type":"text","text":"API網關"}]},{"type":"text","text":",然後直接點擊提交。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/2d\/2d5924a8b320c4a35f4e692c2e5139ed.webp","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"新建觸發策略"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/4d\/4d813a2a18c62a139d579b72414548e9.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"具體操作步驟"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個時候我們其實已經可以通過"},{"type":"codeinline","content":[{"type":"text","text":"url"}]},{"type":"text","text":"進行訪問了,我們複製訪問路徑,然後在瀏覽器訪問,就能看到我們雲函數給我們返回的內容了。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/76\/76fff514ce99d305153b2502779321fd.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"複製鏈接"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/bd\/bd9465b961f5886bce69491299b15ea3.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"訪問步驟"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"本地開發"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"介紹完在雲平臺上創建函數的方式,接下來就該介紹如何進行本地開發並部署的方式了:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"1. 安裝"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這裏將以"},{"type":"codeinline","content":[{"type":"text","text":"Node"}]},{"type":"text","text":"作爲開發語言進行演示,更多語言安裝方式請參考官方文檔。"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"npm i serverless -g"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"先安裝對應的包,這裏可以安裝到全局便於以後使用。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"接着使用相關命令生成"},{"type":"codeinline","content":[{"type":"text","text":"demo"}]},{"type":"text","text":"模板項目:"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"serverless init sls-demo"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"創建完成之後,我們進入生成目錄,映入眼簾的就是一個"},{"type":"codeinline","content":[{"type":"text","text":"src"}]},{"type":"text","text":"目錄和一個"},{"type":"codeinline","content":[{"type":"text","text":"serverless.yml"}]},{"type":"text","text":"配置文件。我們一般將源代碼都放置在"},{"type":"codeinline","content":[{"type":"text","text":"src"}]},{"type":"text","text":"目錄下,當然,這個也看個人喜好,如果你不喜歡,可以選擇放在任意文件夾下,不過就需要修改一下配置文件中的"},{"type":"codeinline","content":[{"type":"text","text":"src"}]},{"type":"text","text":"字段對應的值了,它默認是指向了當前目錄下的"},{"type":"codeinline","content":[{"type":"text","text":"src"}]},{"type":"text","text":"目錄。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"組件信息:"}]},{"type":"embedcomp","attrs":{"type":"table","data":{"content":"
字段名是否必選說明
componentcomponent 的名稱,可使用 sls registry 命令查詢可引入的組件。
name創建的實例名稱,每個組件在部署時將創建一個實例。"}}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"參數信息(inputs下對應的字段):"}]},{"type":"embedcomp","attrs":{"type":"table","data":{"content":"
字段名說明
name雲函數名稱,同時也作爲資源 ID。
src代碼路徑。
handler函數處理方法名稱。
runtime雲函數運行環境,目前支持:Python2.7、Python3.6、Nodejs6.10、Nodejs8.9、Nodejs10.15、Nodejs12.16、PHP5、PHP7、Go1、Java8 和 CustomRuntime。
region雲函數所在的區域。
events觸發器。支持的觸發器爲:timer、apigw、cos、cmq、ckafka 。"}}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"想查詢更多詳細信息可以參考官方文檔。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"2. 開發"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我們可以將業務的各項代碼都放置在"},{"type":"codeinline","content":[{"type":"text","text":"src"}]},{"type":"text","text":"目錄下,這裏以當前"},{"type":"codeinline","content":[{"type":"text","text":"demo"}]},{"type":"text","text":"項目舉例。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我們打開"},{"type":"codeinline","content":[{"type":"text","text":"src\/index.js"}]},{"type":"text","text":",在暴露的這個函數中我們可以盡情的做一些騷操作,然後返回一個結果,並進行測試。你可以連接數據庫操作,或者是發起請求等,根據你自己選取的語言來進行代碼編寫,筆者這裏是選擇的"},{"type":"codeinline","content":[{"type":"text","text":"Nodejs"}]},{"type":"text","text":"環境進行調試。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不僅如此,我們可以配合其他"},{"type":"codeinline","content":[{"type":"text","text":"Node"}]},{"type":"text","text":"框架"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"3. 部署"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"部署就比較簡單了,只要一句小小的命令即可輕鬆部署到雲端:"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"serverless deploy\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你屬於第一次部署的話,將會發現在控制檯打印出了一個二維碼,你需要做的就是用微信進行掃碼授權,然後就靜待部署完成即可。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/f0\/f0ead7eab3da2410594249271d413cd1.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"部署效果預覽"}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這裏你部署完成之後會發現你的目錄下生成了一個"},{"type":"codeinline","content":[{"type":"text","text":".env"}]},{"type":"text","text":"文件,裏面保存了你部署需要用到的私密數據,然後第二次部署時就可以不用掃碼就能成功部署了(這個授權信息是有時效的,如果失效則需要重新授權)。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"4. 調試"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"執行觸發函數命令,"},{"type":"codeinline","content":[{"type":"text","text":"function="}]},{"type":"text","text":" 後面跟着的是你的雲函數名稱,這樣就能判斷是否部署成功了。"}]},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"serverless invoke --inputs function=scfdemo-dev-scf-demo"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"效果預覽:"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/9e\/9e3a2e395fea0559f6f5ec0b877a46a4.png","alt":"Image","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"效果預覽"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"總結"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當然這只是一個入門級的教程,這裏僅僅只是介紹了"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"的一小部分功能,而"},{"type":"codeinline","content":[{"type":"text","text":"Serverless"}]},{"type":"text","text":"的強大遠非如此,這就需要廣大開發者逐步的開啓這個新世界的大門了。"}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章