Giter Club home page Giter Club logo

tencent-multi-scf's Introduction

腾讯云多函数管理流组件

腾讯云多函数管理,方便用户管理多云函数应用。

快速开始

  1. 安装
  2. 配置
  3. 部署
  4. 查看状态
  5. 移除

更多资源:

1. 安装

通过 npm 安装最新版本的 Serverless CLI

$ npm install -g serverless

2. 配置

以下是 multi-scf 组件的 serverless.yml 配置示例:

app: multi-scf
stage: dev

component: multi-scf
name: demo

inputs:
  src:
    src: ./
    exclude:
      - .env
  region: ap-guangzhou
  runtime: Nodejs12.16
  memorySize: 128
  timeout: 3
  functions:
    index:
      handler: app.index
    userList:
      handler: app.userList
      memorySize: 256
      timeout: 10
  triggers:
    - type: apigw
      parameters:
        name: serverless
        protocols:
          - https
          - http
        apis:
          - path: /
            method: GET
            function: index
          - path: /
            method: POST
            function: userList

点此查看全量配置及配置说明

3. 部署

serverless.yml 文件所在的项目根目录,运行以下指令进行部署:

$ serverless deploy

部署时需要进行身份验证,如您的账号未 登陆注册 腾讯云,您可以直接通过 微信 扫描命令行中的二维码进行授权登陆和注册。

注意: 如果希望查看更多部署过程的信息,可以通过 serverless deploy --debug 命令查看部署过程中的实时日志信息。

4. 查看状态

serverless.yml文件所在的目录下,通过如下命令查看部署状态:

$ serverless info

5. 移除

serverless.yml文件所在的目录下,通过以下命令移除部署的 Express 服务。移除后该组件会对应删除云上部署时所创建的所有相关资源。

$ serverless remove

和部署类似,支持通过 serverless remove --debug 命令查看移除过程中的实时日志信息。

账号配置

当前默认支持 CLI 扫描二维码登录,如您希望配置持久的环境变量/秘钥信息,也可以本地创建 .env 文件

$ touch .env # 腾讯云的配置信息

.env 文件中配置腾讯云的 SecretId 和 SecretKey 信息并保存

如果没有腾讯云账号,可以在此注册新账号

如果已有腾讯云账号,可以在API 密钥管理中获取 SecretIdSecretKey.

# .env
TENCENT_SECRET_ID=123
TENCENT_SECRET_KEY=123

License

MIT License

Copyright (c) 2020 Tencent Cloud, Inc.

tencent-multi-scf's People

Contributors

yugasun avatar ciryu avatar jominja avatar wwwzbwcom avatar rong5180 avatar ole3021 avatar mamietian avatar wangxiao996 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.