Skip to content

Commit

Permalink
Move /list endpoint to /api/list (ordinals#288)
Browse files Browse the repository at this point in the history
* Move /list endpoint to /api/list

* list -> api_list
  • Loading branch information
casey authored Aug 5, 2022
1 parent bd2e1f3 commit 281585d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Server {
.route("/", get(Self::root))
.route("/block/:hash", get(Self::block))
.route("/ordinal/:ordinal", get(Self::ordinal))
.route("/list/:outpoint", get(Self::list))
.route("/api/list/:outpoint", get(Self::api_list))
.route("/status", get(Self::status))
.layer(extract::Extension(index))
.layer(
Expand Down Expand Up @@ -206,7 +206,7 @@ impl Server {
}
}

async fn list(
async fn api_list(
extract::Path(outpoint): extract::Path<OutPoint>,
index: extract::Extension<Arc<Index>>,
) -> impl IntoResponse {
Expand Down
6 changes: 3 additions & 3 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn list() -> Result {
.command(&format!("server --address 127.0.0.1 --http-port {port}"))
.block()
.request(
"list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
"api/list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
200,
"[[0,5000000000]]",
)
Expand All @@ -36,13 +36,13 @@ fn continuously_index_ranges() -> Result {
Test::new()?
.command(&format!("server --address 127.0.0.1 --http-port {port}"))
.request(
"list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
"api/list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
404,
"null",
)
.block()
.request(
"list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
"api/list/0396bc915f141f7de025f72ae9b6bb8dcdb5f444fc245d8fac486ba67a38eef9:0",
200,
"[[0,5000000000]]",
)
Expand Down

0 comments on commit 281585d

Please sign in to comment.