Giter VIP home page Giter VIP logo

blog's Introduction

blog

使用说明

1.1环境要求

-golang版本 >= v1.18
-mysql >= 5.0
-redis >= 5.0.14

1.2运行项目

# 克隆项目
git clone [email protected]:fishworm96/blog.git
# 项目配置
必须先配置再启动
根目录下./conf/config.yaml文件
name: "blog"  // 项目名称
mode: "dev"   // 模式
port: 8080  // 运行端口
version: "v0.1.4" // 当前版本
start_time: "2022-07-01" // 开始时间
machine_id: 1 // 雪花算法创建新节点值
email_secret_code: "" // 可选:email smtp秘钥
access_key: "" // 可选配置项:oss access key
secret_key: "" // 可选配置项:oss secret key
bucket: "" // 可选配置项:oss 桶名称
img_url: "" // 可选配置项:解析域名地址

auth:
  jwt_expire: 8760 // jwt 过期时间
log:
  level: "info" // 日志等级
  filename: "blog.log"  // 日志文件名称
  max_size: 200 // 最大大小
  max_age: 30 // 最长时间
  max_backups: 7 // 最多文件
mysql:
  host: "127.0.0.1"  // 重要:mysql host
  port: 3306 // 重要:端口
  user: "root" // 重要:账号
  password: "root" // 重要:密码
  dbname: "blog" // 重要:数据库名称
  max_open_conns: 200 // 重要:最多连接数
  max_idle_conns: 50 // 重要:最大空闲数
redis:
  host: "127.0.0.1" // 重要:redis host
  port: 6379 // 重要:端口
  password: "" // 重要:密码
  db: 0 // 重要:默认数据库
  pool_size: 100 // 重要:最大连接池

1.3启动项目

# 手动启动
go run main.go ./conf/config.yaml
# 使用热更新
go install github.com/cosmtrek/air@latest
在终端中使用
air

# 配置air
根目录下.air.conf

blog's People

Contributors

fishworm96 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.