created: 2024-05-06 11:03 | updated: 2024-05-06 11:03

pproteinのインストール

https://github.com/kaz/pprotein

ローカルでの準備

import

今回はechoのV4なので下記のようにインポート

// pprotein
pprotein "github.com/kaz/pprotein/integration/echov4"

func initializeHandler(c echo.Context) error { に下記追加 initializeを実行する関数 (DBのinitとか)

// pprotein
go func() {
if _, err := http.Get("http://localhost:9000/api/group/collect"); err != nil {
log.Printf("failed to communicate with pprotein: %v", err)
}
}()

main関数に下記追加

// pprotein
pprotein.EnableDebugHandler(e)

そのままだと、pproteinが見れないので、ポートフォワードしてあげる

Terminal window
ssh [email protected] -L localhost:9000:localhost:9000 -i .ssh/fork_github_key

サーバでの準備

pproteinをいれる


Backlinks