Quick Start
This guide is designed to help you get started as quickly as possible.
Initial Setup
There are a few prerequisites you need to install and configure:
- Install Node.js 14.x or later version on your local machine. For details, see Installing Node.js and NPM.
- Install the Serverless Framework open-source CLI 3.28.1 or later version. For details, see Installing the Open-source CLI of the Serverless Framework..
If you already have these prerequisites set up, you can skip ahead to deploy an example service.
Installing Node.js and NPM
- Install Node.js and NPM. For details about the download address, see the download description.
- At the end, you can run node -v from your command line and you will get a result like this:
$ node -v vx.x.x
You can also run npm -v from your command line and you will get a result like this:$ npm -v x.x.x
Installing the Open-source CLI of the Serverless Framework.
- Run this command in your terminal:
npm install -g serverless
- After the installation is complete, you can run serverless -v from your command line and you will get a result like this:
$ serverless -v x.x.x
Creating and Deploying a Serverless Service
The setup is completed, now you can create and deploy a serverless service.
- Create a new service.
- Create a new service with the huawei-nodejs template.
serverless create --template-url https://github.com/zy-linn/examples/tree/v3/legacy/huawei-nodejs --path my-service
- Install the dependencies.
cd my-service npm install
- Create a new service with the huawei-nodejs template.
- Set up the credentials. For details, see credential settings.
- Update the serverless.yml.
Update the region and credentials in serverless.yml.
- Deploy.
Use this command to deploy a service for the first time or to deploy all changes in the service after modifying the functions, events, or resources in the serverless.yml file. For details about this command, see Deploy.
serverless deploy
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot