tencent cloud

Feedback

Creating Function with Serverless Cloud Framework

Last updated: 2024-12-02 20:27:11

    Scenario

    This document describes how to use the SCF component provided by Serverless Cloud Framework to create and deploy an SCF project. For more information, see Components Overview.

    Prerequisites

    Install Serverless Cloud Framework. For more information, see Installation.
    Your account has the Serverless Framework permissions. For more information, see Permission Management.

    Directions

    Creating a function

    Run the following command to create a function in the Node.js language:
    scf init scf-nodejs --name example
    Note:
    scf-nodejs in the command can be replaced with a template for another programming language. SCF supports the following components: scf-golang, scf-nodejs, scf-php, and scf-python.

    Deploying the function

    Run the following command in the scf-demo directory to deploy the function:
    scf deploy
    A QR code will pop up. Please scan it to authorize and start deployment. After successful deployment, SCF resources will be automatically created.
    Note:
    If authentication fails, authorize as instructed in Account and Permission Configuration.

    View function information

    Run the following command to view the information of the deployed SCF resources:
    scf info

    Removing function

    Run the following command to remove the deployed SCF resources:
    scf remove

    Relevant Features

    To use Serverless Cloud Framework to manipulate SCF functions, see Serverless Cloud Framework Overview.
    Serverless Web IDE is a browser-based integrated development environment. It delivers an on-cloud development experience comparable to native IDEs. For more information on its features for SCF, see Serverless Web IDE.
    The SCF SDK integrates function business flow APIs, which simplifies the invocation of functions. For more information on its feature for functions, see SDK for Python and Node.js SDK.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support