All Projects → weiwei2012holy → short_url

weiwei2012holy / short_url

Licence: other
开箱即用的短网址服务——GO语言部署版本

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to short url

YOURLS
🔗 The de facto standard self hosted URL shortener in PHP
Stars: ✭ 9,007 (+30958.62%)
Mutual labels:  short-url

GO版本短网址服务

相关依赖

  1. 基础框架:GIN(https://github.com/gin-gonic/gin)
  2. 数据库:GORM(https://gorm.io/zh_CN/docs/)
  3. Redis:https://github.com/go-redis/redis
  4. 配置管理:https://github.com/spf13/viper
  5. 日期处理:Carbon

部署方法

  1. Clone 本项目
  2. 修改配置cp config.json.tmp config.json,完善配置
  3. 数据迁移go run main/migrate
  4. 启动服务go run main/service

使用方法

  1. 联系管理员获取Key+Secret,注意每个Key的数据相互隔离,数据存在auth数据表中
  2. 通过自定义Header传入验证参数(服务端调用,简单验证)
    1. X-Auth-Key = Key
    2. X-Auth-Secret = Secret
    3. 调用接口:POST 127.0.0.1:8090/api/url ,生成短链,访问短链即可跳转

提供的接口

详见:test目录下 short_url.http

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].