-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
caf979c
commit d963ed7
Showing
15 changed files
with
2,631 additions
and
165 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "http_api" | ||
version = "0.1.0" | ||
edition = { workspace = true } | ||
authors = ["Sigma Prime <contact@sigmaprime.io>"] | ||
|
||
[lib] | ||
name = "http_api" | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
task_executor = { workspace = true } | ||
axum = { workspace = true } | ||
slot_clock = { workspace = true } | ||
serde = { workspace = true } | ||
tokio = { workspace = true } | ||
tracing = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! Configuration for Anchor's HTTP API | ||
use serde::{Deserialize, Serialize}; | ||
use std::net::{IpAddr, Ipv4Addr}; | ||
|
||
/// Configuration for the HTTP server. | ||
#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] | ||
pub struct Config { | ||
pub enabled: bool, | ||
pub listen_addr: IpAddr, | ||
pub listen_port: u16, | ||
pub allow_origin: Option<String>, | ||
} | ||
|
||
impl Default for Config { | ||
fn default() -> Self { | ||
Self { | ||
enabled: false, | ||
listen_addr: IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), | ||
listen_port: 5062, | ||
allow_origin: None, | ||
} | ||
} | ||
} |
Oops, something went wrong.