{"componentChunkName":"component---src-templates-blog-detail-tsx","path":"/blog/2020-07-08-serverlessdays-tencent","result":{"data":{"currentBlog":{"id":"f0e1b35d-4f26-5db6-a5c1-a8ed4e501674","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/202078/1594199170941-1594192713077-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.jpg","authors":["方坤丁"],"categories":["news"],"date":"2020-07-08T00:00:00.000Z","title":"企业级 Serverless 应用实战","description":"本文整理自 ServerlessDay · China 大会 - 《企业级 Serverless 应用实战》的分享，讲师为腾讯云 Serverless 高级产品经理方坤丁。","authorslink":["https://github.com/tinafangkunding"],"translators":null,"translatorslink":null,"tags":["ServerlessDays","Meetup"],"keywords":"Serverless, ServerlessDays, Serverless实践,","outdated":null},"wordCount":{"words":515,"sentences":94,"paragraphs":94},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-07-08-serverlessdays-tencent.md","fields":{"slug":"/blog/2020-07-08-serverlessdays-tencent/","keywords":["go","next.js","nextjs","nodejs","serverless","spa","zeit","客户端渲染","云函数","Serverless","serverless","部署"]},"html":"<blockquote>\n<p>本文整理自 ServerlessDay · China 大会 - 《企业级 Serverless 应用实战》的分享，讲师为腾讯云 Serverless 高级产品经理方坤丁。</p>\n</blockquote>\n<p>本文主要分为四个部分：</p>\n<ol>\n<li>Serverless 2020 : 趋势与挑战</li>\n<li>Serverless 典型场景</li>\n<li>部署企业级 Serverless 应用</li>\n<li>实战演示 : Serverless SSR</li>\n</ol>\n<h2 id=\"serverless-2020--趋势与挑战\"><a href=\"#serverless-2020--%E8%B6%8B%E5%8A%BF%E4%B8%8E%E6%8C%91%E6%88%98\" aria-label=\"serverless 2020  趋势与挑战 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Serverless 2020 : 趋势与挑战</h2>\n<p>首先，谈一下对于 Serverless 在 2020 的趋势。我大概是从 3-4 年前开始接触 Serverless，到了今年，发现有以下一些特征，我会把他们分成三个部分：</p>\n<ul>\n<li>第一点，对于开发者来说，Serverless 通过按需付费、弹性扩缩容的特性，极大的赋能开发者，让他们关注于实现业务，而不需要考虑底层资源。</li>\n<li>第二点，对于越来越多的企业来说，从2019年开始，他们逐步开始尝试、深入使用甚至拥抱 Serverless。因为 Serverless 能够显著的降低成本，并且减少运维的工作。这对于企业来说，尤其是非科技企业来说，是有非常强的吸引力的。并且在 2020年，已经可以看出更多的企业在借助 Serverless 来实现业务了。</li>\n<li>第三点，可以看到云服务和 Serverless 的结合越来越紧密。刚才也说到 BaaS 本身是 Serverless 中的重要部分。那么在 2020 年，越来越多的云服务，正在通过 Serverless 的方式提供。比如 PG SQL 提供了 Serverless DB ，Serverless HTTP，以及上午提到的 Serverless AI 等服务。</li>\n</ul>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594193406089-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_1594193397639.png\" alt=\"Serverless\"></p>\n<p>但是，与此同时，我们也发现，随着这些趋势的发展，也面临了不少的挑战，依然分成三个方面来讨论：</p>\n<ul>\n<li>对于开发者来说，怎么提供一个完整的开发、调试和排障的能力，并且提供更强大的扩展能力，是非常关键的。也就是生态的建设。</li>\n<li>对于企业来说，面临的问题更加细节，很多概念在工业化的实践中，都会遇到很多实际的问题。包括权限的划分、资源的管理、还有 CI/CD 等解决方案，怎样无缝适配到企业的架构中呢？</li>\n<li>最后，对于云来说，结合越发紧密，但是云产品为了保证通用性和普适性，本身会有比较复杂的配置，并且云资源直接的组合需要带来比较大的学习成本，也对于企业带来了不少挑战。</li>\n</ul>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594193406087-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_1594193397639.png\" alt=\"Serverless\"></p>\n<h2 id=\"serverless-典型场景\"><a href=\"#serverless-%E5%85%B8%E5%9E%8B%E5%9C%BA%E6%99%AF\" aria-label=\"serverless 典型场景 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Serverless 典型场景</h2>\n<p>那么，在和企业的实践中，我们也发现 Serverless 对于几种典型的场景支持的非常优秀，在这里也希望和大家分享：</p>\n<ul>\n<li><strong>第一种就是 Serverless SSR</strong>，这是一个偏前端的场景。产生背景是因为 CSR 是客户端渲染，需要浏览器端进行 js 文件的执行得到交互页面。但是缺点是 SEO 不够友善，并且首屏打开的性能不足。但是 SSR 因为涉及服务端，需要考虑 node server 的扩缩容、运维等等，让很多开发者望而却步。但是 Serverless SSR 可以很好地支持这一场景。</li>\n</ul>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192711713-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<ul>\n<li><strong>第二种是结合网关+函数，提供通用的 RESTful 平台</strong>，这种场景在之前 19 年一个 Serverless 的调研中，是 70% 用户都在使用的典型场景。也就是将前后端资源 Serverless 化，提供增删改查的能力。</li>\n</ul>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192712479-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<ul>\n<li><strong>最后一个，Serverless 的全栈应用也非常有市场</strong>。通过提供前端、后端以及数据库端。组合不同的组件，可以非常完美的支持全栈应用的部署，同时也不会失去灵活性，可以很好地拆分前后端。</li>\n</ul>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192712657-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<h2 id=\"部署企业级-serverless-应用\"><a href=\"#%E9%83%A8%E7%BD%B2%E4%BC%81%E4%B8%9A%E7%BA%A7-serverless-%E5%BA%94%E7%94%A8\" aria-label=\"部署企业级 serverless 应用 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>部署企业级 Serverless 应用</h2>\n<p>接下来谈谈部署企业级应用的几个诉求。这里的一些经验都是在实际的上云过程中，客户反馈，并且提到的非常多的问题。也是我们在帮客户一起查看问题的时候，实际解决的问题。</p>\n<p>比如我们的一个客户，希望 All in Serverless，这几个问题他们全都遇到过，那么我们可以一起来看下是怎样解决的。</p>\n<p>在我们帮助企业客户部署 Serverless 应用的时候，需要考虑到的几个特性：</p>\n<ul>\n<li>权限管理</li>\n<li>资源、环境的划分</li>\n<li>运维、排障能力</li>\n<li>CI/CD</li>\n</ul>\n<p>接下来，我们逐个看一下，企业客户在上云过程中是怎么解决这些问题的：</p>\n<h3 id=\"权限管理\"><a href=\"#%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86\" aria-label=\"权限管理 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>权限管理</h3>\n<p>当前在大企业中，需要使用主账号+子账户的用户、用户组划分权限。但是怎样让子账户之间权限隔离，更加安全的部署资源一直都是一个挑战。为了确保子账户之间的隔离和细粒度控制，Serverless Framework 开发平台支持在 serverless.yml 文件中，通过指定配置角色来获取对应权限。同时，支持运维配置不同的角色只能被某个子账户调用，从而保证其严格隔离。</p>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192712031-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"serverless\"></p>\n<h3 id=\"资源环境划分\"><a href=\"#%E8%B5%84%E6%BA%90%E7%8E%AF%E5%A2%83%E5%88%92%E5%88%86\" aria-label=\"资源环境划分 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>资源/环境划分</h3>\n<p>随着企业客户 Serverless 架构上云过程中，资源的增长，不可避免会出现资源管理困难，需要有效划分资源，隔离环境的问题。那么，腾讯云 Serverless Framework 是怎样解决这个问题的呢？</p>\n<p>主要是通过 yaml 配置中对 stage、 app 和 org 等几个字段的灵活引用，并且在控制台中提供开箱即用的资源管理视图的查看，从而有效的隔离不同环境中的底层资源。</p>\n<p>如下面例子，对应的 yaml 配置中，stage 字段可以从 .env 中读取配置；此外对应的资源名称中可以用 <code class=\"language-text\">${app}-${stage}</code> 的方式动态命名。从而针对不同环境创建配置相同、相互隔离的资源。</p>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192711986-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<h3 id=\"运维排障\"><a href=\"#%E8%BF%90%E7%BB%B4%E6%8E%92%E9%9A%9C\" aria-label=\"运维排障 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>运维/排障</h3>\n<p>运维和排障一直是 Serverless 架构中客户反馈很多的问题，主要集中于以下两个方面：</p>\n<ul>\n<li>缺乏应用级别的监控概览图，配置门槛高；</li>\n<li>链路较长，不透明，故障难以排查。</li>\n</ul>\n<p>针对这样的情况，腾讯 Serverless Framework 提供了开箱即用的应用级别监控视图，并且结合高级的日志查询功能，可以有效降低配置的学习成本，快速排障定位问题。</p>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192711450-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<h3 id=\"cicd\"><a href=\"#cicd\" aria-label=\"cicd permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CI/CD</h3>\n<p>针对企业客户来说，接入自动化的 CI/CD 流程十分必要，主要有如下几个优势点：</p>\n<ul>\n<li>减少重复操作，提升发布效率</li>\n<li>降低风险，避免手动操作导致的故障</li>\n<li>流程透明，充分的校验和测试</li>\n</ul>\n<p>那么针对企业级客户连接 CI/CD 的诉求，Serverless Framework 既支持开源 CI/CD 产品的打通，如 Jenkins, Github Actions 等，也支持和 Coding 产品的一键打通，从而针对 Serverless 应用提供了“0”配置的 CI/CD 解决方案，实现构建、部署的流程的自动化。</p>\n<p><img src=\"https://img.serverlesscloud.cn/202078/1594192713173-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15941925279560.png\" alt=\"Serverless\"></p>\n<h2 id=\"实战：快速部署基于-nextjs-的-serverless-ssr-应用\"><a href=\"#%E5%AE%9E%E6%88%98%EF%BC%9A%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2%E5%9F%BA%E4%BA%8E-nextjs-%E7%9A%84-serverless-ssr-%E5%BA%94%E7%94%A8\" aria-label=\"实战：快速部署基于 nextjs 的 serverless ssr 应用 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>实战：快速部署基于 Next.js 的 Serverless SSR 应用</h2>\n<p>最后，通过一个 Serverless SSR 的实战，演示一个 SSR 应用快速部署，并提供了动静分离（静态资源托管到对象存储），提供了开箱即用的应用级别监控的能力。从而实现了完善的脚手架能力，并且可以方便的针对权限管理、灰度和 CICD 进行打通及扩展。</p>\n<h3 id=\"操作场景\"><a href=\"#%E6%93%8D%E4%BD%9C%E5%9C%BA%E6%99%AF\" aria-label=\"操作场景 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>操作场景</h3>\n<p><strong>腾讯云 <a href=\"https://github.com/zeit/next.js\">Next.js</a> 组件</strong>通过使用 <a href=\"https://github.com/serverless/components/tree/cloud\"><strong>Tencent Serverless Framework</strong></a>，基于云上 Serverless 服务（如 API 网关、云函数等），实现「0」配置，便捷开发，极速部署采用 Next.js 框架的网页应用，Next.js 组件支持丰富的配置扩展，提供了目前便捷实用，开发成本低的网页应用项目的开发/托管能力。</p>\n<p>Next.js 特性介绍：</p>\n<ul>\n<li><strong>按需付费</strong>：按照请求的使用量进行收费，没有请求时无需付费。</li>\n<li><strong>「0」配置</strong>：只需要关心项目代码，之后部署即可，Serverless Framework 会搞定所有配置。</li>\n<li><strong>极速部署</strong>：部署速度快，仅需几秒，部署您的整个应用。</li>\n<li><strong>实时日志</strong>：通过实时日志的输出查看业务状态，便于直接在云端开发应用。</li>\n<li><strong>云端调试</strong>：可在云端直接进行项目调试，从而避免本地环境的差异。</li>\n<li><strong>便捷协作</strong>：通过云端控制台的状态信息和部署日志，方便进行多人协作开发。</li>\n</ul>\n<h3 id=\"前提条件\"><a href=\"#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6\" aria-label=\"前提条件 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>前提条件</h3>\n<ul>\n<li>已安装 Node.js（参考 <a href=\"https://nodejs.org/zh-cn/download/\">Node.js 安装指南</a>）。</li>\n<li>在本地创建一个 Next.js 项目并初始化：</li>\n</ul>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"25550805872372350000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`\\$ mkdir serverless-next && cd serverless-next\n\\$ npm init next-app src`, `25550805872372350000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">mkdir</span> serverless-next <span class=\"token operator\">&amp;&amp;</span> <span class=\"token builtin class-name\">cd</span> serverless-next\n$ <span class=\"token function\">npm</span> init next-app src</code></pre></div>\n<h3 id=\"操作步骤\"><a href=\"#%E6%93%8D%E4%BD%9C%E6%AD%A5%E9%AA%A4\" aria-label=\"操作步骤 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>操作步骤</h3>\n<h4 id=\"1-安装\"><a href=\"#1-%E5%AE%89%E8%A3%85\" aria-label=\"1 安装 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. 安装</h4>\n<p>通过 npm 全局安装 <a href=\"https://github.com/serverless/serverless\">Serverless CLI</a>：</p>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"95630639201029260000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`\\$ npm install -g serverless`, `95630639201029260000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">npm</span> <span class=\"token function\">install</span> -g serverless</code></pre></div>\n<h4 id=\"2-配置\"><a href=\"#2-%E9%85%8D%E7%BD%AE\" aria-label=\"2 配置 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. 配置</h4>\n<p>在项目根目录（此例中为serverless-next）下创建 <code class=\"language-text\">serverless.yml</code> 文件：</p>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"36966508265444700000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`\\$ touch serverless.yml`, `36966508265444700000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">touch</span> serverless.yml</code></pre></div>\n<p>在  <code class=\"language-text\">serverless.yml</code>  中进行如下配置：</p>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"82977299808248090000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`# serverless.yml\ncomponent: nextjs # (必填) 组件名称，此处为nextjs\nname: nextjsDemo # (必填) 实例名称\norg: orgDemo # (可选) 用于记录组织信息，默认值为您的腾讯云账户 appid\napp: appDemo # (可选) 该 next.js 应用名称\nstage: dev # (可选) 用于区分环境信息，默认值是 dev\n\ninputs:\n  src: \n  \tsrc: ./src\n    exclude:\n      - .env\n  functionName: nextjsDemo\n  region: ap-shanghai\n  runtime: Nodejs10.15\n  apigatewayConf:\n    protocols:\n      - http\n      - https\n    environment: release`, `82977299808248090000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"yml\"><pre class=\"language-yml\"><code class=\"language-yml\"><span class=\"token comment\"># serverless.yml</span>\n<span class=\"token key atrule\">component</span><span class=\"token punctuation\">:</span> nextjs <span class=\"token comment\"># (必填) 组件名称，此处为nextjs</span>\n<span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> nextjsDemo <span class=\"token comment\"># (必填) 实例名称</span>\n<span class=\"token key atrule\">org</span><span class=\"token punctuation\">:</span> orgDemo <span class=\"token comment\"># (可选) 用于记录组织信息，默认值为您的腾讯云账户 appid</span>\n<span class=\"token key atrule\">app</span><span class=\"token punctuation\">:</span> appDemo <span class=\"token comment\"># (可选) 该 next.js 应用名称</span>\n<span class=\"token key atrule\">stage</span><span class=\"token punctuation\">:</span> dev <span class=\"token comment\"># (可选) 用于区分环境信息，默认值是 dev</span>\n\n<span class=\"token key atrule\">inputs</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">src</span><span class=\"token punctuation\">:</span> \n  \t<span class=\"token key atrule\">src</span><span class=\"token punctuation\">:</span> ./src\n    <span class=\"token key atrule\">exclude</span><span class=\"token punctuation\">:</span>\n      <span class=\"token punctuation\">-</span> .env\n  <span class=\"token key atrule\">functionName</span><span class=\"token punctuation\">:</span> nextjsDemo\n  <span class=\"token key atrule\">region</span><span class=\"token punctuation\">:</span> ap<span class=\"token punctuation\">-</span>shanghai\n  <span class=\"token key atrule\">runtime</span><span class=\"token punctuation\">:</span> Nodejs10.15\n  <span class=\"token key atrule\">apigatewayConf</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">protocols</span><span class=\"token punctuation\">:</span>\n      <span class=\"token punctuation\">-</span> http\n      <span class=\"token punctuation\">-</span> https\n    <span class=\"token key atrule\">environment</span><span class=\"token punctuation\">:</span> release</code></pre></div>\n<p>查看 <a href=\"https://github.com/serverless-components/tencent-nextjs/tree/v2/docs/configure.md\">更多配置及说明 >></a></p>\n<h4 id=\"3-部署\"><a href=\"#3-%E9%83%A8%E7%BD%B2\" aria-label=\"3 部署 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. 部署</h4>\n<p><strong>3.1 构建静态资源</strong></p>\n<p>进入到 next 项目目录下，构建静态资源：</p>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"23779447114694554000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`\\$ cd src && npm run build`, `23779447114694554000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token builtin class-name\">cd</span> src <span class=\"token operator\">&amp;&amp;</span> <span class=\"token function\">npm</span> run build</code></pre></div>\n<p><strong>3.2 部署到云端</strong></p>\n<p>回到在 serverless.yml 文件所在的项目根目录，运行以下指令进行部署：</p>\n<div\n              class=\"gatsby-code-button-container\"\n              data-toaster-id=\"49224566922444390000\"\n              data-toaster-class=\"gatsby-code-button-toaster\"\n              data-toaster-text-class=\"gatsby-code-button-toaster-text\"\n              data-toaster-text=\"代码复制成功\"\n              data-toaster-duration=\"3500\"\n              onClick=\"copyToClipboard(`\\$ sls deploy\nserverless ⚡ framework\nAction: &quot;deploy&quot; - Stage: &quot;dev&quot; - App: &quot;appDemo&quot; - Instance: &quot;nextjsDemo&quot;\n\nregion: ap-shanghai\napigw: \n  serviceId:   service-xxxxxx\n  subDomain:   service-xxxxxx-10000000.sh.apigw.tencentcs.com\n  environment: release\n  url:         https://service-xxxxxx-10000000.sh.apigw.tencentcs.com/release/\nscf: \n  functionName: nextjsDemo\n  runtime:      Nodejs10.15\n  namespace:    default\n\n\n59s › nextjsDemo › Success`, `49224566922444390000`)\"\n            >\n              <div\n                class=\"gatsby-code-button\"\n                data-tooltip=\"\"\n              >\n                复制代码<svg class=\"gatsby-code-button-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M16 1H2v16h2V3h12V1zm-1 4l6 6v12H6V5h9zm-1 7h5.5L14 6.5V12z\"/></svg>\n              </div>\n            </div>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ sls deploy\nserverless ⚡ framework\nAction: <span class=\"token string\">\"deploy\"</span> - Stage: <span class=\"token string\">\"dev\"</span> - App: <span class=\"token string\">\"appDemo\"</span> - Instance: <span class=\"token string\">\"nextjsDemo\"</span>\n\nregion: ap-shanghai\napigw: \n  serviceId:   service-xxxxxx\n  subDomain:   service-xxxxxx-10000000.sh.apigw.tencentcs.com\n  environment: release\n  url:         https://service-xxxxxx-10000000.sh.apigw.tencentcs.com/release/\nscf: \n  functionName: nextjsDemo\n  runtime:      Nodejs10.15\n  namespace:    default\n\n\n59s › nextjsDemo › Success</code></pre></div>\n<p>部署时需要进行身份验证，如您的账号未 <a href=\"https://cloud.tencent.com/login\">登录</a> 或 <a href=\"https://cloud.tencent.com/register\">注册</a> 腾讯云，您可以直接通过<strong>微信</strong>扫描命令行中的二维码进行授权登录和注册。</p>\n<blockquote>\n<p>如果希望查看更多部署过程的信息，可以通过 <code class=\"language-text\">sls deploy --debug</code> 命令查看部署过程中的实时日志信息（<code class=\"language-text\">sls</code>是 <code class=\"language-text\">serverless</code> 命令的缩写）。</p>\n</blockquote>\n<h4 id=\"4-开发调试\"><a href=\"#4-%E5%BC%80%E5%8F%91%E8%B0%83%E8%AF%95\" aria-label=\"4 开发调试 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. 开发调试</h4>\n<p>部署了 Next.js 应用后，可以通过开发调试能力对该项目进行二次开发，从而开发一个生产应用。在本地修改和更新代码后，不需要每次都运行 <code class=\"language-text\">serverless deploy</code> 命令来反复部署。您可以直接通过 <code class=\"language-text\">serverless dev</code> 命令对本地代码的改动进行检测和自动上传。\n可以通过在 <code class=\"language-text\">serverless.yml</code>文件所在的目录下运行 <code class=\"language-text\">serverless dev</code> 命令开启开发调试能力。\n<code class=\"language-text\">serverless dev</code> 同时支持实时输出云端日志，每次部署完毕后，对项目进行访问，即可在命令行中实时输出调用日志，便于查看业务情况和排障。</p>\n<p>除此之外，我们经过压测发现，该架构的性能和自建 node server 相比持平，甚至在响应时间方面更加有优势；而在价格测算上，基于 Serverless 弹性伸缩，按需付费的特点，有着十分显著的优势。</p>\n<h4 id=\"5-查看部署状态\"><a href=\"#5-%E6%9F%A5%E7%9C%8B%E9%83%A8%E7%BD%B2%E7%8A%B6%E6%80%81\" aria-label=\"5 查看部署状态 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>5. 查看部署状态</h4>\n<p>在 <code class=\"language-text\">serverless.yml</code> 文件所在的目录下，通过如下命令查看部署状态：</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">$ serverless info\nserverless ⚡ framework\n\n\nLast Action:  ifo (a few seconds ago)\nDeployments:  21\nStatus:       active\n\nregion: ap-shanghai\napigw: \n  serviceId:   service-xxxxxx\n  subDomain:   service-xxxxxx-10000000.sh.apigw.tencentcs.com\n  environment: release\n  url:         https://service-xxxxxx-10000000.sh.apigw.tencentcs.com/release/\nscf: \n  functionName: nextjsDemo\n  runtime:      Nodejs10.15\n  namespace:    default\n\nnextjsDemo › Info successfully loaded</code></pre></div>\n<p>最后，我相信 Serverless 的时代已经到来，它能够赋能开发者，助力企业上云，并将重新定义云的概念！</p>\n<hr>\n<div id='scf-deploy-iframe-or-md'></div>\n<hr>\n<blockquote>\n<p><strong>传送门：</strong></p>\n<ul>\n<li>GitHub: <a href=\"https://github.com/serverless/serverless/blob/master/README_CN.md\">github.com/serverless</a></li>\n<li>官网：<a href=\"https://serverless.com/\">serverless.com</a></li>\n</ul>\n</blockquote>\n<p>欢迎访问：<a href=\"https://serverlesscloud.cn/\">Serverless 中文网</a>，您可以在 <a href=\"https://serverlesscloud.cn/best-practice\">最佳实践</a> 里体验更多关于 Serverless 应用的开发！</p>","tableOfContents":"<ul>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#serverless-2020--%E8%B6%8B%E5%8A%BF%E4%B8%8E%E6%8C%91%E6%88%98\">Serverless 2020 : 趋势与挑战</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#serverless-%E5%85%B8%E5%9E%8B%E5%9C%BA%E6%99%AF\">Serverless 典型场景</a></li>\n<li>\n<p><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E9%83%A8%E7%BD%B2%E4%BC%81%E4%B8%9A%E7%BA%A7-serverless-%E5%BA%94%E7%94%A8\">部署企业级 Serverless 应用</a></p>\n<ul>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86\">权限管理</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E8%B5%84%E6%BA%90%E7%8E%AF%E5%A2%83%E5%88%92%E5%88%86\">资源/环境划分</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E8%BF%90%E7%BB%B4%E6%8E%92%E9%9A%9C\">运维/排障</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#cicd\">CI/CD</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E5%AE%9E%E6%88%98%EF%BC%9A%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2%E5%9F%BA%E4%BA%8E-nextjs-%E7%9A%84-serverless-ssr-%E5%BA%94%E7%94%A8\">实战：快速部署基于 Next.js 的 Serverless SSR 应用</a></p>\n<ul>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E6%93%8D%E4%BD%9C%E5%9C%BA%E6%99%AF\">操作场景</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6\">前提条件</a></li>\n<li>\n<p><a href=\"/blog/2020-07-08-serverlessdays-tencent/#%E6%93%8D%E4%BD%9C%E6%AD%A5%E9%AA%A4\">操作步骤</a></p>\n<ul>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#1-%E5%AE%89%E8%A3%85\">1. 安装</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#2-%E9%85%8D%E7%BD%AE\">2. 配置</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#3-%E9%83%A8%E7%BD%B2\">3. 部署</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#4-%E5%BC%80%E5%8F%91%E8%B0%83%E8%AF%95\">4. 开发调试</a></li>\n<li><a href=\"/blog/2020-07-08-serverlessdays-tencent/#5-%E6%9F%A5%E7%9C%8B%E9%83%A8%E7%BD%B2%E7%8A%B6%E6%80%81\">5. 查看部署状态</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>"},"previousBlog":{"id":"4f6a66f1-0167-5a7d-a0bf-70517b5cd51b","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020710/1594369778294-1594295165809-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15942951126394.jpg","authors":["卢萌凯/董文枭/董文强/李垦"],"categories":["news"],"date":"2020-07-09T00:00:00.000Z","title":"Serverless 应用实践及典型案例解析","description":"本文整理自 ServerlessDay · China 大会 - 《Serverless 应用实践及典型案例解析》的分享。","authorslink":null,"translators":null,"translatorslink":null,"tags":["ServerlessDays","Meetup"],"keywords":"Serverless, ServerlessDays, Serverless实践","outdated":null},"wordCount":{"words":467,"sentences":51,"paragraphs":51},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-07-09-serverlessdays-tencent-2.md","fields":{"slug":"/blog/2020-07-09-serverlessdays-tencent-2/","keywords":["go","serverless","单页应用","服务端渲染","云函数","云原生","Serverless","函数","serverlesscloud","转码","前端"]}},"nextBlog":{"id":"623e3f00-9b6f-5ee8-b5c8-57b386e28cb4","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/202077/1594104885073-1594024750794-%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_15940247379968.jpg","authors":["金鑫"],"categories":["news"],"date":"2020-07-06T00:00:00.000Z","title":"基于 API 网关 + 云函数 SCF 部署 Serverless 外卖订单系统","description":"API 网关结合云函数 SCF 的使用场景非常丰富，本文将介绍基于 API 网关 + 云函数 SCF 部署 Serverless 的外卖订单系统。","authorslink":["https://github.com/leonardjin"],"translators":null,"translatorslink":null,"tags":["API 网关","Meetup"],"keywords":"Serverless, Serverless Registry, Serverless网关","outdated":null},"wordCount":{"words":203,"sentences":46,"paragraphs":46},"fileAbsolutePath":"/opt/build/repo/content/blog/2020-07-06-serverless-api-scf.md","fields":{"slug":"/blog/2020-07-06-serverless-api-scf/","keywords":["serverless","云函数","Serverless","serverless","函数","tencent","serverlesscloud"]}},"recommendBlogs":{"edges":[{"node":{"id":"73576d26-e0ce-5f26-9330-64b4f3889157","frontmatter":{"thumbnail":"https://main.qcloudimg.com/raw/3cb7b20955d78ced738e0279bb3f6f41.jpg","authors":["AndreaPasswater"],"categories":["news","engineering-culture"],"date":"2018-03-09T00:00:00.000Z","title":"Serverless 数据解读：2018 报告","description":"Serverless Framework 使用统计数据：事件源、服务结构、运行时长等等。","authorslink":["https://serverless.com/author/andreapasswater/"],"translators":["Aceyclee"],"translatorslink":["https://www.zhihu.com/people/Aceyclee"],"tags":["事件源","服务结构"],"keywords":"Serverless 统计数据,Serverless 事件源,Serverless 服务结构","outdated":null},"wordCount":{"words":212,"sentences":45,"paragraphs":45},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-03-09-serverless-by-the-numbers-2018-data-report.md","fields":{"slug":"/blog/2018-03-09-serverless-by-the-numbers-2018-data-report/","keywords":["go","serverless","无服务器","云函数","服务","使用率","Go","部署"]}}},{"node":{"id":"84876745-cbfb-5c1d-9f6c-7c74338d5d28","frontmatter":{"thumbnail":"https://s3-us-west-2.amazonaws.com/assets.site.serverless.com/images/champions/champions_banner.jpg","authors":["RupakGanguly"],"categories":["news","engineering-culture"],"date":"2018-04-10T00:00:00.000Z","title":"2018 年首批无服务器社区冠军介绍","description":"无服务器社区冠军是无服务器社区的领导者。快来认识一下我们 2018 年度的社区英雄吧！","authorslink":null,"translators":null,"translatorslink":null,"tags":null,"keywords":null,"outdated":null},"wordCount":{"words":194,"sentences":32,"paragraphs":32},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-04-10-announcing-new-2018-serverless-champions.md","fields":{"slug":"/blog/2018-04-10-announcing-new-2018-serverless-champions/","keywords":["serverless","webpack","无服务器","无服务器架构","服务器","serverless","champions","架构","blog","github","框架"]}}},{"node":{"id":"1e1a90fc-3b65-540c-b726-755999e7912a","frontmatter":{"thumbnail":"https://main.qcloudimg.com/raw/8a0db1c9fd8b51c15d0b006291d52bf5.jpg","authors":["AndreaPasswater"],"categories":["news","engineering-culture"],"date":"2018-07-19T00:00:00.000Z","title":"2018 年社区调查：Serverless 使用率大幅增长","description":"我们曾在开发社区进行问卷调查，询问 Serverless 的使用情况。它的使用率增长连我们自己都惊讶不已，下面来看看数据。","authorslink":["https://serverless.com/author/andreapasswater/"],"translators":["Aceyclee"],"translatorslink":["https://www.zhihu.com/people/Aceyclee"],"tags":["Component","Serverless"],"keywords":"Serverless 社区调查,Serverless 使用情况,Serverless 数据","outdated":null},"wordCount":{"words":267,"sentences":50,"paragraphs":49},"fileAbsolutePath":"/opt/build/repo/content/blog/2018-07-19-2018-serverless-community-survey-huge-growth-usage.md","fields":{"slug":"/blog/2018-07-19-2018-serverless-community-survey-huge-growth-usage/","keywords":["go","serverless","无服务器","Serverless","serverless"]}}},{"node":{"id":"8311b008-2b15-5225-8adc-9b75e484177b","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880819419-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%286%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-04-08T00:00:00.000Z","title":"邀您参加 | K8S&云原生技术开放日-北京站","description":"K8S&云原生技术开放日，将围绕K8S、Serverless等云原生相关技术，从最佳落地实践、不同场景技术改造、应用优化，到开源领域深度技术研究，和技术爱好者们一起探讨。","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["云原生","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":36,"sentences":9,"paragraphs":9},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-04-08-k8s.md","fields":{"slug":"/blog/2019-04-08-k8s/","keywords":["serverless","云原生","serverless","Serverless","技术","原生","serverlesscloud","github"]}}},{"node":{"id":"25f709db-cde0-59d7-81f4-944c46a6dd8a","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880571672-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%285%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-04-04T00:00:00.000Z","title":"Serverless 技术风暴来袭，开发者该如何应对？","description":"Hello Serverless技术沙龙北京站，将围绕Serverless的应用场景，客户案例，FaaS+BaaS架构的实现方案等，针对未来的无服务形态进行交流和讨论，释放技术想象！","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["应用场景","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":37,"sentences":8,"paragraphs":8},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-04-04-technology-storm.md","fields":{"slug":"/blog/2019-04-04-technology-storm/","keywords":["serverless","Serverless","serverless","serverlesscloud","github","技术","架构","围绕"]}}},{"node":{"id":"4bc4d946-6187-5c3d-91c6-d98c4c4c1314","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020414/1586880172144-%E5%B0%81%E9%9D%A2%E5%9B%BE%20%284%29.png","authors":["serverless 社区"],"categories":["news"],"date":"2019-06-11T00:00:00.000Z","title":"一图读懂无服务器云函数","description":"本图将重要信息进行梳理和提炼，帮助读者更好的理解无服务器云函数的理念和作用","authorslink":["https://zhuanlan.zhihu.com/ServerlessGo"],"translators":null,"translatorslink":null,"tags":["云函数","Serverless"],"keywords":"serverless 入门,serverless 框架,腾讯云 serverless","outdated":null},"wordCount":{"words":31,"sentences":6,"paragraphs":6},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-06-11-one-picture-serverless-cloud-function.md","fields":{"slug":"/blog/2019-06-11-one-picture-serverless-cloud-function/","keywords":["serverless","无服务器","无服务器云函数","云函数","serverless","serverlesscloud","Serverless","github","开发者","函数"]}}},{"node":{"id":"1cd76f95-14a9-5fd5-926b-456af189b7ed","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/2020326/1585217744291-%E6%91%84%E5%9B%BE%E7%BD%91_400730082_wx.jpg","authors":["朱峰 Ben"],"categories":["news"],"date":"2019-10-14T00:00:00.000Z","title":"由浅入深说 Serverless 之云函数的生命周期","description":"希望通过文章分享帮助大家更深入的了解 Serverless 背后的机制并掌握相关的最佳实践。","authorslink":["https://github.com/jiangliu5267"],"translators":null,"translatorslink":null,"tags":["云函数"],"keywords":"Serverless, Serverless前端开发, Serverless云函数","outdated":null},"wordCount":{"words":74,"sentences":29,"paragraphs":29},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-14-serverless-cloud-function.md","fields":{"slug":"/blog/2019-10-14-serverless-cloud-function/","keywords":["faas","java","云函数","函数","触发","实例","事件","数据库","启动","连接","sql","代码"]}}},{"node":{"id":"4f16f8bc-1a35-5394-9029-f7abc2ad6137","frontmatter":{"thumbnail":"https://img.serverlesscloud.cn/qianyi/images/YHl6UWa9s629ucl0iaVcic8rL06uEBM5go4LSXiaHnibDJSBjLGAhGlWz3QZ1RZzd3NeCibjJxOyUApDO7TaPYcwxsw.jpg","authors":["Serverless 中文网"],"categories":["news"],"date":"2019-10-26T00:00:00.000Z","title":"Hello Serverless 实战沙龙回顾","description":"2019 年 10 月 26 日，Hello Serverless 沙龙活动在广州市海珠区腾讯众创空间成功举办，一起看看我们都为大家准备了哪些精彩的演讲吧！","authorslink":["https://github.com/jiangliu5267"],"translators":null,"translatorslink":null,"tags":["Meetup"],"keywords":"Serverless, Serverless技术沙龙,Hello Serverless","outdated":null},"wordCount":{"words":64,"sentences":13,"paragraphs":13},"fileAbsolutePath":"/opt/build/repo/content/blog/2019-10-26-hello-serverless-meetup.md","fields":{"slug":"/blog/2019-10-26-hello-serverless-meetup/","keywords":["go","serverless","云函数","云原生","Serverless","存储","腾讯","serverlesscloud"]}}}],"totalCount":46}},"pageContext":{"isCreatedByStatefulCreatePages":false,"blogId":"f0e1b35d-4f26-5db6-a5c1-a8ed4e501674","previousBlogId":"4f6a66f1-0167-5a7d-a0bf-70517b5cd51b","nextBlogId":"623e3f00-9b6f-5ee8-b5c8-57b386e28cb4","categories":["news"]}}}