Fix example in readme for #456 (#475)

This commit is contained in:
kozabrada123 2024-01-31 22:53:13 +01:00 committed by GitHub
parent 282602d5c3
commit fde7f18d57
1 changed files with 1 additions and 7 deletions

View File

@ -53,16 +53,10 @@ To connect to a Spacebar compatible server, you need to create an [`Instance`](h
```rs
use chorus::instance::Instance;
use chorus::UrlBundle;
#[tokio::main]
async fn main() {
let bundle = UrlBundle::new(
"https://example.com/api".to_string(),
"wss://example.com/".to_string(),
"https://example.com/cdn".to_string(),
);
let instance = Instance::new(bundle)
let instance = Instance::new("https://example.com")
.await
.expect("Failed to connect to the Spacebar server");
// You can create as many instances of `Instance` as you want, but each `Instance` should likely be unique.