https://github.com/phyuany/tiny-url
用rust编写的简易短链接服务
https://github.com/phyuany/tiny-url
Last synced: 3 months ago
JSON representation
用rust编写的简易短链接服务
- Host: GitHub
- URL: https://github.com/phyuany/tiny-url
- Owner: phyuany
- Created: 2022-12-16T16:41:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T07:29:52.000Z (over 2 years ago)
- Last Synced: 2025-01-22T21:43:49.696Z (5 months ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tiny-url 短链接服务
## 一、概述
rust编写的简易短链接服务
参考视频:
## 二、怎样运行该项目?
### 2.1 启动mysql数据库
如果没有shell执行环境,请忽略下面的启动脚本
进入数据库操作目录
```shell
cd db
```启动数据库
```shell
./start.sh
```此时启动两个服务:
- mysql的docker容器服务
- phpmyadmin的docker容器服务打开 查看数据库
### 2.2 移除mysql数据库
```shell
./shutdown.sh
```执行脚本后,mysql和phpmyadmin两个容器将被销毁。
### 2.3 运行服务
```shell
# 回到项目根目录
cd ../
# 执行cargo run
cargo run
```## 三、接口列表
| 序号 | 路由 | 备注 |
|-----|---------|-------|
| 1 | / | |
| 2 | /create | 创建短链接 |
| 3 | /{code} | 访问短链接 |
| 4 | /links | 查询短链接 |