Added api route for getting raw block
This commit is contained in:
@ -68,6 +68,14 @@ def get_block_ids():
|
||||
def get_block_stats():
|
||||
return list(map(lambda h: h.to_dict(), load_block_stats()))
|
||||
|
||||
@app.get("/rawblock/<post_id>")
|
||||
def get_rawblock(post_id: int = None):
|
||||
assert post_id is not None
|
||||
return Response(
|
||||
mimetype = "application/octet-stream",
|
||||
response = load_block(int(post_id)).dumps(),
|
||||
)
|
||||
|
||||
@app.get("/block/<post_id>")
|
||||
def get_block(post_id: int = None):
|
||||
assert post_id is not None
|
||||
|
||||
Reference in New Issue
Block a user