Skip to content

Files

Latest commit

author
mayism
Nov 15, 2021
4cda2b8 · Nov 15, 2021

History

History

agc-cloudfunction-demo-javascript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 20, 2021
Dec 10, 2020
Mar 1, 2021
Nov 11, 2021
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Dec 10, 2020
Jan 20, 2021
Nov 15, 2021
Nov 15, 2021
Dec 10, 2020
Nov 15, 2021

Cloud functions quickstart

English | 中文

Table of Contents

Introduction

Cloud Functions enables serverless computing. It provides the Function as a Service (FaaS) capabilities to simplify app development and O&M so your functions can be implemented more easily and your service capabilities can be built more quickly.

Preparing the Environments

  • A computer can compile and run Vue project

Getting Started

Before running the cloud functions quickstart, you need to:

  1. If you do not have a HUAWEI Developer account, you need to register an account and pass identity verification.
  2. Use your account to sign in to AppGallery Connect, create a project and add an app, set app platform to Web.
  3. Select your project and app in My projects, and go to Build > Cloud Functions to enable the Cloud Functions.
  4. Select Project Settings, copy the SDK Code Snippet json from AppGallery Connect and paste the json to config.js in this demo.
  5. Select your project and app in My projects, and go to Build > Cloud Functions, create a function and an HTTP trigger.
  6. Run the following code in terminal in the demo path, and demo will start.
    # install dependencies
    npm install
    
    # install AGC cloud functions sdk
    npm install @agconnect/function@1.3.1 --save
    
    # run demo
    npm start
  7. Input your HTTP trigger and request body in the demo and click run.
  8. More details about Cloud Functions

Sample Code

Sample code: src\components*

Result

function

Question or issues

If you have questions about how to use AppGallery Connect Demos, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with AppGallery.
  • Huawei Developer Forum AppGallery Module is great for general questions, or seeking recommendations and opinions.

If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.

License

cloud functions quickstart is licensed under the Apache License, version 2.0.