1 Star 0 Fork 0

qianjin / go-apiServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

go-apiServer

介绍

GO语言编写的静态资源服务器,也可用于mock JSON请求,自用

软件架构

使用全宇宙最快的go框架Iris编写

安装教程

  1. $go get github.com/kataras/iris/v12@master # or @v12.2.0-beta7

使用说明

  • tip:windows系统运行后,若命令行卡住,可以按一下回车
  1. property-config.json请参考默认的配置
{
    "port": "9998",
    "data_path": "E:/fqfin/visionary-server/mockData",
    "public_path": "E:/fqfin/server-public/resource/statics",
    "public_prefix": "./statics",
    "debug_level": "info",
    "memory_cache": false
}
  1. 默认使用9999端口,如冲突请修改为其他即可
  2. 默认配置./mockData为JSON文件夹, 最多支持三层嵌套/xx/xx/xx[.post | .delete | .put | .patch].json
    • 拷贝你的JSON文件夹到mockData下,如 /mockData/api/*.json
    • *.json可用于GET请求,*.post.json用于POST请求, PUT,DELETE,PATCH等依次类推
  3. 静态资源目录请配置public_path字段,资源的请求路径需要以public_prefix字段配置的值开头,默认为/statics
  4. 日志等级请配置debug_level字段,默认为info
  5. 是否开启内存缓存请配置memory_cache字段,开启时会很吃内存且初次启动慢(卡住请等待),但是响应超级快;建议默认关闭该选项
  6. 日志自定义请配置logger-config.json
{
    "status": true,
    "ip": true,
    "method": true,
    "path": true,
    "query": true
}
  1. go-apiServer为macos m1可用,go-apiServer.exe为amd64可用,其他操作系统请自行编译

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
MIT License Copyright (c) 2023 qianjin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

GO语言编写的静态资源服务器,也可用于mock JSON请求 展开 收起
Go
MIT
取消

发行版 (2)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/pangqianjin/go-api-server.git
git@gitee.com:pangqianjin/go-api-server.git
pangqianjin
go-api-server
go-apiServer
master

搜索帮助