mirror of
https://github.com/logos-blockchain/logos-blockchain-block-explorer-template.git
synced 2026-01-03 13:43:05 +00:00
24 lines
787 B
Python
24 lines
787 B
Python
from fastapi import APIRouter
|
|
|
|
from . import blocks, health, index, transactions
|
|
|
|
|
|
def create_v1_router() -> APIRouter:
|
|
"""
|
|
Route order must be preserved.
|
|
"""
|
|
router = APIRouter()
|
|
|
|
router.add_api_route("/", index.index, methods=["GET", "HEAD"])
|
|
|
|
router.add_api_route("/health/stream", health.stream, methods=["GET", "HEAD"])
|
|
router.add_api_route("/health", health.get, methods=["GET", "HEAD"])
|
|
|
|
router.add_api_route("/transactions/stream", transactions.stream, methods=["GET"])
|
|
router.add_api_route("/transactions/{transaction_hash:str}", transactions.get, methods=["GET"])
|
|
|
|
router.add_api_route("/blocks/stream", blocks.stream, methods=["GET"])
|
|
router.add_api_route("/blocks/{block_hash:str}", blocks.get, methods=["GET"])
|
|
|
|
return router
|