In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to deploy Serverless". In daily operation, I believe many people have doubts about how to deploy Serverless. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to deploy Serverless". Next, please follow the editor to study!
The following three configurations are essential:
[build] # the root directory of the project and the directory where the npm command was executed base = "" # static files to be serviced, and also the directory generated after packaging: publish = ".vuepress / dist" # Packaging command command = "npm run build"
Serverless deployment
In Tencent Cloud Serverless, configuration files are required to deploy applications. To deploy a pure front-end page, you need to use a component of tencent-website and deploy it using the above configuration.
The following is the Serverless configuration file for building my blog [1] using vuepress, and creating a new configuration file serverless.yaml in the root directory. The configuration is as follows:
For more detailed configuration, please see: Serverless Website full configuration [2]
Component: website # (required) refers to the name of component. Currently you are using the tencent-website component name: shanyue-blog # (required) the name of the instance created by the website component inputs: src: src:. Index: index.html dist: .vuepress / dist hook: npm run build # websitePath:. / region: ap-guangzhou bucketName: my-bucket protocol: https
Set two environment variables before executing the command (I threw them all under bashrc when I was lazy), which can be found in Tencent Cloud's account system:
Export TENCENT_SECRET_ID=shanyue-id export TENCENT_SECRET_KEY=shanyue-key
Everything is ready but Dongfeng, an order is done:
# download in advance: npm I-g serverless $sls serverless ⚡ framework Action: "deploy"-Stage: "dev"-App: "shanyue-blog"-Instance: "shanyue-blog" region: ap-guangzhou website: https://my-bucket-1257314149.cos-website.ap-guangzhou.myqcloud.com Full details: https://serverless.cloud.tencent.com/apps/shanyue-blog/shanyue-blog/dev 103s > shanyue-blog > Success so far The study on "how to deploy Serverless" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.