mirror of
https://github.com/tribufu/tribufu-rust
synced 2026-06-01 09:42:37 +00:00
Add dotenv to example
This commit is contained in:
parent
f309fd834c
commit
67fcf7ce3b
2 changed files with 19 additions and 0 deletions
18
examples/token.rs
Normal file
18
examples/token.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved
|
||||
|
||||
use dotenv::dotenv;
|
||||
use std::env;
|
||||
use tribufu::*;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
dotenv().ok();
|
||||
|
||||
let client_id = env::var("CLIENT_ID").unwrap().parse::<u64>().unwrap();
|
||||
let client_secret = env::var("CLIENT_SECRET").unwrap();
|
||||
|
||||
let client = TribufuClient::new(client_id, client_secret).unwrap();
|
||||
let token = client.get_token().await.unwrap();
|
||||
|
||||
println!("{:?}", token)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue