mirror of
https://github.com/linux-do/new-api.git
synced 2025-10-12 02:23:40 +08:00
Rename to One API
This commit is contained in:
44
README.md
44
README.md
@@ -3,40 +3,40 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/songquanpeng/gin-template"><img src="https://raw.githubusercontent.com/songquanpeng/gin-template/main/web/public/logo.png" width="150" height="150" alt="gin-template logo"></a>
|
||||
<a href="https://github.com/songquanpeng/one-api"><img src="https://raw.githubusercontent.com/songquanpeng/one-api/main/web/public/logo.png" width="150" height="150" alt="one-api logo"></a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
# Gin 项目模板
|
||||
# Gin One API
|
||||
|
||||
_✨ 用于 Gin & React 项目的模板 ✨_
|
||||
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://raw.githubusercontent.com/songquanpeng/gin-template/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/songquanpeng/gin-template?color=brightgreen" alt="license">
|
||||
<a href="https://raw.githubusercontent.com/songquanpeng/one-api/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/songquanpeng/one-api?color=brightgreen" alt="license">
|
||||
</a>
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/songquanpeng/gin-template?color=brightgreen&include_prereleases" alt="release">
|
||||
<a href="https://github.com/songquanpeng/one-api/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/songquanpeng/one-api?color=brightgreen&include_prereleases" alt="release">
|
||||
</a>
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases/latest">
|
||||
<img src="https://img.shields.io/github/downloads/songquanpeng/gin-template/total?color=brightgreen&include_prereleases" alt="release">
|
||||
<a href="https://github.com/songquanpeng/one-api/releases/latest">
|
||||
<img src="https://img.shields.io/github/downloads/songquanpeng/one-api/total?color=brightgreen&include_prereleases" alt="release">
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/songquanpeng/gin-template">
|
||||
<img src="https://goreportcard.com/badge/github.com/songquanpeng/gin-template" alt="GoReportCard">
|
||||
<a href="https://goreportcard.com/report/github.com/songquanpeng/one-api">
|
||||
<img src="https://goreportcard.com/badge/github.com/songquanpeng/one-api" alt="GoReportCard">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/songquanpeng/gin-template/releases">程序下载</a>
|
||||
<a href="https://github.com/songquanpeng/one-api/releases">程序下载</a>
|
||||
·
|
||||
<a href="https://github.com/songquanpeng/gin-template#部署">部署教程</a>
|
||||
<a href="https://github.com/songquanpeng/one-api#部署">部署教程</a>
|
||||
·
|
||||
<a href="https://github.com/songquanpeng/gin-template/issues">意见反馈</a>
|
||||
<a href="https://github.com/songquanpeng/one-api/issues">意见反馈</a>
|
||||
·
|
||||
<a href="https://gin-template.vercel.app/">在线演示</a>
|
||||
<a href="https://one-api.vercel.app/">在线演示</a>
|
||||
</p>
|
||||
|
||||
## 功能
|
||||
@@ -54,25 +54,25 @@ _✨ 用于 Gin & React 项目的模板 ✨_
|
||||
|
||||
## 部署
|
||||
### 手动部署
|
||||
1. 从 [GitHub Releases](https://github.com/songquanpeng/gin-template/releases/latest) 下载可执行文件或者从源码编译:
|
||||
1. 从 [GitHub Releases](https://github.com/songquanpeng/one-api/releases/latest) 下载可执行文件或者从源码编译:
|
||||
```shell
|
||||
git clone https://github.com/songquanpeng/gin-template.git
|
||||
git clone https://github.com/songquanpeng/one-api.git
|
||||
go mod download
|
||||
go build -ldflags "-s -w" -o gin-template
|
||||
go build -ldflags "-s -w" -o one-api
|
||||
````
|
||||
2. 运行:
|
||||
```shell
|
||||
chmod u+x gin-template
|
||||
./gin-template --port 3000 --log-dir ./logs
|
||||
chmod u+x one-api
|
||||
./one-api --port 3000 --log-dir ./logs
|
||||
```
|
||||
3. 访问 [http://localhost:3000/](http://localhost:3000/) 并登录。初始账号用户名为 `root`,密码为 `123456`。
|
||||
|
||||
更加详细的部署教程[参见此处](https://iamazing.cn/page/how-to-deploy-a-website)。
|
||||
|
||||
### 基于 Docker 进行部署
|
||||
执行:`docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/gin-template`
|
||||
执行:`docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/one-api:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/one-api`
|
||||
|
||||
数据将会保存在宿主机的 `/home/ubuntu/data/gin-template` 目录。
|
||||
数据将会保存在宿主机的 `/home/ubuntu/data/one-api` 目录。
|
||||
|
||||
## 配置
|
||||
系统本身开箱即用。
|
||||
@@ -87,7 +87,7 @@ _✨ 用于 Gin & React 项目的模板 ✨_
|
||||
2. `SESSION_SECRET`:设置之后将使用固定的会话密钥,这样系统重新启动后已登录用户的 cookie 将依旧有效。
|
||||
+ 例子:`SESSION_SECRET=random_string`
|
||||
3. `SQL_DSN`:设置之后将使用指定数据库而非 SQLite。
|
||||
+ 例子:`SQL_DSN=root:123456@tcp(localhost:3306)/gin-template`
|
||||
+ 例子:`SQL_DSN=root:123456@tcp(localhost:3306)/one-api`
|
||||
|
||||
### 命令行参数
|
||||
1. `--port <port_number>`: 指定服务器监听的端口号,默认为 `3000`。
|
||||
|
Reference in New Issue
Block a user