用于 Gin & React 项目的模板. Template for Gin & React projects.
See the code中文 | English
✨ 用于 Gin & React 项目的模板 ✨
执行:docker run --name gin-template -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data justsong/gin-template
数据将会保存在宿主机的 /home/ubuntu/data/gin-template 目录。
git clone https://github.com/songquanpeng/gin-template.git
cd gin-template/web
npm install
npm run build
cd ..
go mod download
go build -ldflags "-s -w" -o gin-template
chmod u+x gin-template
./gin-template --port 3000 --log-dir ./logs
root,密码为 123456。更加详细的部署教程参见此处。
系统本身开箱即用。
你可以通过设置环境变量或者命令行参数进行配置。
等到系统启动后,使用 root 用户登录系统并做进一步的配置。
REDIS_CONN_STRING:设置之后将使用 Redis 作为请求频率限制的存储,而非使用内存存储。
REDIS_CONN_STRING=redis://default:redispw@localhost:49153SESSION_SECRET:设置之后将使用固定的会话密钥,这样系统重新启动后已登录用户的 cookie 将依旧有效。
SESSION_SECRET=random_stringSQL_DSN:设置之后将使用指定数据库而非 SQLite。
SQL_DSN=root:123456@tcp(localhost:3306)/gin-template--port <port_number>: 指定服务器监听的端口号,默认为 3000。
--port 3000--log-dir <log_dir>: 指定日志文件夹,如果没有设置,日志将不会被保存。
--log-dir ./logs--version: 打印系统版本号并退出。87 followers · starred Jan 2024
用于 Gin & React 项目的模板. Template for Gin & React projects.
See the code中文 | English
✨ 用于 Gin & React 项目的模板 ✨
执行:docker run --name gin-template -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data justsong/gin-template
数据将会保存在宿主机的 /home/ubuntu/data/gin-template 目录。
git clone https://github.com/songquanpeng/gin-template.git
cd gin-template/web
npm install
npm run build
cd ..
go mod download
go build -ldflags "-s -w" -o gin-template
chmod u+x gin-template
./gin-template --port 3000 --log-dir ./logs
root,密码为 123456。更加详细的部署教程参见此处。
系统本身开箱即用。
你可以通过设置环境变量或者命令行参数进行配置。
等到系统启动后,使用 root 用户登录系统并做进一步的配置。
REDIS_CONN_STRING:设置之后将使用 Redis 作为请求频率限制的存储,而非使用内存存储。
REDIS_CONN_STRING=redis://default:redispw@localhost:49153SESSION_SECRET:设置之后将使用固定的会话密钥,这样系统重新启动后已登录用户的 cookie 将依旧有效。
SESSION_SECRET=random_stringSQL_DSN:设置之后将使用指定数据库而非 SQLite。
SQL_DSN=root:123456@tcp(localhost:3306)/gin-template--port <port_number>: 指定服务器监听的端口号,默认为 3000。
--port 3000--log-dir <log_dir>: 指定日志文件夹,如果没有设置,日志将不会被保存。
--log-dir ./logs--version: 打印系统版本号并退出。87 followers · starred Jan 2024