diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7b5f572 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# WebSocket URL +WEBSOCKET_URL="ws://localhost:8888/ws/computer" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ea8c4bf..0b745e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.env \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9c75379..4804cf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,3 +5,12 @@ version = 3 [[package]] name = "computer" version = "0.1.0" +dependencies = [ + "dotenvy", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" diff --git a/Cargo.toml b/Cargo.toml index 4a0049b..d005970 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] +dotenvy = "0.15.7" diff --git a/src/main.rs b/src/main.rs index e7a11a9..86f9690 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,9 @@ -fn main() { +use std::error::Error; + +fn main() -> Result<(), Box> { + dotenvy::dotenv()?; + println!("Hello, world!"); + + Ok(()) }