Skip to content

Commit

Permalink
fix: eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fxzer committed Aug 1, 2024
1 parent d236191 commit 4f71369
Show file tree
Hide file tree
Showing 43 changed files with 948 additions and 3,719 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/styles/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
.container .VPFeature.link:hover {
border: 1px solid var(--vp-c-brand-light) !important;
}
.container .VPFeature > article .details{
.container .VPFeature > article .details {
line-height: 1em !important;
}
.container .VPFeature > article {
Expand Down
24 changes: 11 additions & 13 deletions docs/BackEnd/NodeJS/Node学习笔记.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,8 @@ console.log(m1.age) // 20

**前端两种服务器:**

​ Web 网站服务器:专门对外提供 Web 网页资源服务器

​ API 接口服务器:专门对外提供 API 接口服务器
Web 网站服务器:专门对外提供 Web 网页资源服务器
API 接口服务器:专门对外提供 API 接口服务器

### 1.Express 创建服务器

Expand Down Expand Up @@ -315,20 +314,19 @@ app.listen(80, () => {
- **局部中间件**

```js

...
const mw1 = (req,res,next) => {
console.log('中间件mw1被执行了');
req.age= 18
// ...
function mw1(req, res, next) {
console.log('中间件mw1被执行了')
req.age = 18
next()
}
//在路由加一个参数,
app.get('/mw1',mw1,(req,res)=>{
console.log('req.age: ', req.age);
console.log('mw1被访问');
// 在路由加一个参数,
app.get('/mw1', mw1, (req, res) => {
console.log('req.age: ', req.age)
console.log('mw1被访问')
res.send('mw1被访问哈哈哈')
})
...
// ...
```

- **多个局部中间件**
Expand Down
28 changes: 14 additions & 14 deletions docs/BackEnd/Server/Docker学习笔记.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

## 五、CentOS安装Docker

```bash
```zsh
sudo yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Expand All @@ -45,15 +45,15 @@ docker run hello-world #测试

### 1. Docker

```bash
```zsh
systemctl enable docker #开机启动
docker system df #负载查看

```

### 2. 镜像

```bash
```zsh
docker images #展示本地镜像 -a 所有,-q只显示ID
docker search mongo #搜索镜像
docker search redis --limit 5 #展示Stars排名前五条
Expand All @@ -67,15 +67,15 @@ docker rmi -f hello-world #强制删除镜像
**生成新镜像**

```bash
```zsh
agt-get update
apt-get -y install vim
docker commit -m="vim is ok" -a="fxj" 容器id myubt:1.1
```

**本地镜像推送到阿里云**

```bash
```zsh
#发布和拉取
docker login --username=yunzhishangfxj registry.cn-hangzhou.aliyuncs.com
docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/fanxj/mubt:[镜像版本号]
Expand All @@ -87,7 +87,7 @@ docker run -it registry.cn-hangzhou.aliyuncs.com/fanxj/mubt:1.1 /bin/bash #记

### 3. 容器

```bash
```zsh
docker ps #列出正在运行容器 -a -s
docker run -it --name="ub01" ubuntu /bin/bash
#-p: 外部主机端口:docker容器端口 -P:随机分配主机端口映射到内部容器端口
Expand All @@ -109,21 +109,21 @@ docker ps -a -q | xargs docker rm #一次性删除多个再运行的

#### 启动守护式

```bash
```zsh
docker run -it #前台交互启动
docker run -d #后台守护启动
```

#### 查看容器日志

```bash
```zsh
docker logs 容器id #查看容器日志
docker inspect 容器id #查看容器内部细节
```

#### 容器备份到主机

```bash
```zsh
docker cp 容器id:容器文件路径 目的主机路径 #备份文件
docker export 容器id > xxx.tar #备份整个容器
cat ub.tar | docker import - 恢复后的镜像名 #从tar包中恢复成镜像
Expand Down Expand Up @@ -194,7 +194,7 @@ USER

## 九、Docker网络

```bash
```zsh
docker network ls #查看网络
docker network inspect 网络名 #查看网络源数据
docker network rm 网络名 #删除网络
Expand All @@ -210,22 +210,22 @@ docker run -d --network none --name 容器名 镜像名 #只有lo网卡

#### 共用网卡

```bash
```zsh
docker run -d --network container:另一个容器名 --name 容器名 /bin/bash 镜像名
#共用的容器关闭,这个容器网卡也没有啦
```

#### 自定义网络

```bash
```zsh
#启动两个网桥模式容器
docker run -d -p 8081:8080 --name tomcat81 tomcat
docker run -d -p 8082:8080 --name tomcat82 tomcat

#两个ip可以相互ping通,痛点:按域名ping不通
```

```bash
```zsh
docker run -d -p 8081:8080 --network my_network --name tomcat81 tomcat
docker run -d -p 8082:8080 --network my_network --name tomcat82 tomcat
#ip、域名互ping都能通(维护好主机和ip的关系)
Expand All @@ -237,7 +237,7 @@ docker run -d -p 8082:8080 --network my_network --name tomcat82 tomcat
#### 1. [安装Compose](https://docs.docker.com/compose/install/)

```bash
```zsh
curl -SL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
```

Expand Down
4 changes: 2 additions & 2 deletions docs/BackEnd/Server/Nginx学习笔记.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kill -INT 进程号 | 快速停止 |

## 编写配置

```bash
```zsh
nginx -t #检查配置文件有没有问题
grep -Ei "\{|\}" nginx.conf #检查配置文件括号配对问题
nginx -s reload #重载配置
Expand All @@ -40,7 +40,7 @@ nginx -s reload #重载配置

## CentOS7联网

```bash
```zsh
ip a #查看网卡
cd /etc/sysconfig/network-scripts
vi ifcfg-ens160 #把ONBOOT=no ===> 改为yes
Expand Down
Loading

0 comments on commit 4f71369

Please sign in to comment.