源码分析
前端使用react实现:
https://github.com/prometheus/prometheus/tree/main/web/ui
, 打包工具使用rollup使用make指令构建项目;
测试时间有点长;占用9090端口(如果9090端口已使用会导致测试不通过);
测试框架使用testify
定义api路由的位置:
web\web.go
, 另一个地方是web/api/vi/api.go的Register
方法路由包使用了第三方库
github.com/julienschmidt/httprouter
make test默认情况下是测试go代码和ui代码,ui代码无限卡住。
通过MakeFile代码了解到可以单独测试Go代码
make common-test
或者设置变量GO_ONLY=1然后执行make test
以后单独测试ui,看下为什么卡住了
构建静态资源
make assets