Commit 8af6726b authored by Ethen Pociask's avatar Ethen Pociask

[indexer.docs] Updated api.go

parent ea0bf501
......@@ -2,7 +2,6 @@ package api
import (
"encoding/json"
"fmt"
"net/http"
"github.com/ethereum-optimism/optimism/indexer/database"
......@@ -10,14 +9,6 @@ import (
"github.com/go-chi/chi/v5"
)
const (
depositPath = "/api/v0/deposits/"
withdrawalPath = "/api/v0/withdrawals/"
healthzPath = "/healthz"
addressParam = "{address:.+}"
)
type PaginationResponse struct {
// TODO type this better
Data interface{} `json:"data"`
......@@ -100,9 +91,9 @@ func NewApi(bv database.BridgeTransfersView) *Api {
// these regex are .+ because I wasn't sure what they should be
// don't want a regex for addresses because would prefer to validate the address
// with go-ethereum and throw a friendly error message
r.Get(fmt.Sprintf("%s%s", depositPath, addressParam), api.L1DepositsHandler)
r.Get(fmt.Sprintf("%s%s", withdrawalPath, addressParam), api.L2WithdrawalsHandler)
r.Get(healthzPath, api.HealthzHandler)
r.Get("/api/v0/deposits/{address:.+}", api.L1DepositsHandler)
r.Get("/api/v0/withdrawals/{address:.+}", api.L2WithdrawalsHandler)
r.Get("/healthz", api.HealthzHandler)
return api
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment