feat: add configuration through file
A file named `config.toml` can now be used to load the address, port, and some websocket configuration settings. Fixes https://todo.sr.ht/~gheartsfield/nostr-rs-relay/3
This commit is contained in:
@@ -34,6 +34,8 @@ pub enum Error {
|
||||
CommandUnknownError,
|
||||
#[error("SQL error")]
|
||||
SqlError(rusqlite::Error),
|
||||
#[error("Config error")]
|
||||
ConfigError(config::ConfigError),
|
||||
}
|
||||
|
||||
impl From<rusqlite::Error> for Error {
|
||||
@@ -56,3 +58,10 @@ impl From<WsError> for Error {
|
||||
Error::WebsocketError(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<config::ConfigError> for Error {
|
||||
/// Wrap Config error
|
||||
fn from(r: config::ConfigError) -> Self {
|
||||
Error::ConfigError(r)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user