Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Cloud development Docsify document deployment


May 27, 2021 Web Cloud Development and Web Hosting Learning Guide



Here's a quick introduction:

Cloud Development: CloudBase is a cloud-based, all-in-one product solution that uses serverless architecture, environment-free construction, and other operations, supporting one cloud and many ends, helping to quickly build small programs, web applications, mobile applications.

Cloud development static site hosting supports the use of cloud development SDK to invoke service-side resources such as cloud functions, cloud storage, cloud databases, etc., thereby expanding static sites to full stack sites

Docsify :d ocsify dynamically generates documentation sites. U nlike GitBook, it does not generate static html files. I nstead, it intelligently loads and analyzes your Markdown files and displays them as a website. To get started with it, simply create an .html and deploy it on a static site hosting page.

Next, we'll take three steps: build the environment→ create the project → deployment

Build the environment

1. Install .js and npm

Use the node-v command to see if the machine is installed, and if not, refer to the node.js installation guide to install according to the computer system environment

2. Install cloudbase/cli

  1. npm install -g @cloudbase/cli

3. Install docsify-cli

  1. npm i docsify-cli -g

4. Test the installation for success

  1. cloudbase -v
  2. docsify -v

If you see the output version number, it has been installed successfully.

Create a project

Initialize the project

  1. docsify init docs

Once the initialization is complete, you can modify the contents of the /docs/README.md file and then run it locally

Cloud development Docsify document deployment

Run the local server

  1. docsify serve docs

After successful operation, open the browser and visit localhost:3000

Cloud development Docsify document deployment

Deployment

Create a cloud development environment

Visit Tencent Cloud Development Console, create a new "Billing Cloud Development Environment", remember the cloud development environment ID, we need to use cloud development website hosting services, currently only the metered environment to support static hosting.

Cloud development Docsify document deployment

Go to the site hosting control page to launch a static site hosting service

Cloud development Docsify document deployment

When you see an interface like this, it's already open.

Cloud development Docsify document deployment

Log in

  1. tcb login

This time you will be reminded that you need to authorize on the web page and confirm the authorization on the pop-up page

Cloud development Docsify document deployment

After confirming the authorization, you will see the console output the appropriate command

Execute the command to upload the file and remember to replace the EnvID here with the environment ID of your own environment

  1. tcb hosting:deploy ./ -e EnvID

Wait a moment and the file will be uploaded

Cloud development Docsify document deployment

View static site domain names and statuses

  1. tcb hosting:detail -e envId

This time you will see static website domain name, open browser access on it

Cloud development Docsify document deployment

This is when you can access the Cloud Development Console to view uploaded files

Cloud development Docsify document deployment

Click settings and you'll see the default domain name just output from the console, but you can also add your own domain name

Summary

The environment ID envId used during deployment can be viewed in the cloud development console, and the basic use of docsify can be viewed on its official website

If you're having trouble with the operation, you can comment on leaving your question