编程知识 cdmana.com

Tencent cloud serverless usage and deployment of docusaurus

The premise to prepare

npm install -g serverless
npm update -g serverless
* serverless -v
Framework Core: 2.8.0
Plugin: 4.1.1
SDK: 2.3.2
Components: 3.2.7

Rapid deployment

* serverless
Serverless:  Currently, no detection of  Serverless  project , Whether you want to create a new project ? Yes
Serverless:  Please select the one you want to create  Serverless  application  vue-starter -  Quickly deploy a  Vue.js  Basic applications 
Serverless:  Please enter project name  demo
Serverless:  Installing  vue-starter  application ...

vue-starter › Created

demo  Project successfully created !

Serverless:  Whether you want to deploy the project to the cloud immediately ? Yes

Please scan QR code login from wechat.
Wait login...
Login successful for TencentCloud.

serverless framework
Action: "deploy" - Stage: "dev" - App: "demo" - Instance: "vue-starter"

region:  ap-guangzhou
website: https://my-vue-starter-1255876835.cos-website.ap-guangzhou.myqcloud.com

Full details: https://serverless.cloud.tencent.com/apps/demo/vue-starter/dev

Serverless The application has been successfully deployed , You will enjoy  30  Days free quota . Billing details :https://url.cn/T1uSQD5C

88s › vue-starter › Success

visit https://my-vue-starter-125587... Check the application .

Check the information

* cd demo
* sls info

serverless framework

Last Action:  deploy (8 minutes ago)
Deployments:  1
Status:       active
More Info:    Full details: https://serverless.cloud.tencent.com/apps/demo/vue-starter/dev

region:                ap-guangzhou
website:               https://my-vue-starter-1255876835.cos-website.ap-guangzhou.myqcloud.com
sourceCodeDownloadUrl: https://sp-ins-prod-1300963013.cos.ap-guangzhou.myqcloud.com/**

vue-starter › Info successfully loaded

Development and debugging

sls dev

Remove items

sls remove

Deploy Docusaurus

Create an

npx @docusaurus/init@next init my-site classic

function :

cd my-site
yarn start

Deploy the application

cd my-site
touch serverless.yml

serverless.yml:

component: website
name: doc-starter
app: demo
inputs:
  src:
    src: ./src
    hook: yarn build
    dist: ./build
  bucketName: my-doc-starter
  protocol: https

Deploy :

serverless

Serverless Console

visit https://serverless.cloud.tenc... Check the application :

Conclusion

Welcome to your attention GoCoding official account , Share everyday Coding The practical tips in 、 Little knowledge !

版权声明
本文为[GoCoding]所创,转载请带上原文链接,感谢

Scroll to Top