This commit is contained in:
2023-07-18 01:11:42 +08:00
parent 6448bd8709
commit 5fbc3082c7
45 changed files with 516 additions and 666 deletions

View File

@@ -2,46 +2,69 @@
sidebar_position: 1
---
# Tutorial Intro
# 快速开始
Let's discover **Docusaurus in less than 5 minutes**.
让我们在 **5分钟内完成 zhub 组件安装**.
## Getting Started
## 开始
Get started by **creating a new site**.
从零开始 **搭建 zhub 服务**.
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
### 下载软件包
### What you'll need
- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
## Generate a new site
Generate a new Docusaurus site using the **classic template**.
The classic template will automatically be added to your project after you run the command:
- [zhub.zip](https://baidu.com) 包含以下内容:
- 绿色版本 Window 和 Linux 运行包
- 配置文件: app.ini
- java连接驱动zhub-clien.jar
![zhub-zip.png](https://img.1216.top/docs/zhub-zip.png)
### 配置 app.ini
```bash
npm init docusaurus@latest my-website classic
# app.ini
[log]
handlers=console # console|file
level=debug # info|debug|error
file=zhub.log
[service]
watch=0.0.0.0:711
addr=0.0.0.0:1216
auth=1 # 是否开启连接授权
[data]
dir=D:/data # 数据目录
[ztimer] # timer 使用的数据库配置
db.addr=47.111.150.118:6063
db.user=root
db.password=*Zhong@0510!
db.database=zhub
[auth]
admin=123456 # 授权连接账号 admin@123456
lxy=123456
```
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
The command also installs all necessary dependencies you need to run Docusaurus.
## Start your site
Run the development server:
### 启动服务
```bash
cd my-website
npm run start
# window
./zhub.exe
# linux
./zhub.sh
```
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
## 使用
### Java 客户端连接
```java
ZhubClient zhub = new ZhubClient("", "");
zhub.subscribe("topic-x", x -> {
// do something.
});
```
### Java 客户端连接
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.