Compare commits
2 Commits
e1a782ea91
...
9e3d10d857
Author | SHA1 | Date | |
---|---|---|---|
9e3d10d857 | |||
7dbdfec160 |
5
.woodpecker.yml
Normal file
5
.woodpecker.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
pipeline:
|
||||||
|
test:
|
||||||
|
image: rust:alpine
|
||||||
|
commands:
|
||||||
|
- cargo test
|
@ -1,9 +1,7 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
extern crate reqwest;
|
extern crate reqwest;
|
||||||
|
|
||||||
pub mod models;
|
pub mod models;
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
use std::env;
|
|
||||||
use dotenv::dotenv;
|
use dotenv::dotenv;
|
||||||
|
use std::env;
|
||||||
mod requester;
|
mod requester;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
dotenv().ok();
|
dotenv().ok();
|
||||||
let api_token = env::var("TANDOOR_TOKEN").expect("Token needed");
|
let api_token = env::var("TANDOOR_TOKEN").expect("Token needed");
|
||||||
let entries = requester::fetch_shopping_list_entries(&api_token).await;
|
let entries = requester::fetch_shopping_list_entries(&api_token).await;
|
||||||
println!("{:?}",entries)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ use std::env;
|
|||||||
|
|
||||||
pub async fn fetch_shopping_list_entries(api_token: &str) -> Option<Vec<ShoppingListEntry>> {
|
pub async fn fetch_shopping_list_entries(api_token: &str) -> Option<Vec<ShoppingListEntry>> {
|
||||||
let base_url = env::var("TANDOOR_BASE_URL").expect("Base Url needed");
|
let base_url = env::var("TANDOOR_BASE_URL").expect("Base Url needed");
|
||||||
|
|
||||||
let route = "/shopping-list-entry/";
|
let route = "/shopping-list-entry/";
|
||||||
let url = format!("{}{}", base_url, route);
|
let url = format!("{}{}", base_url, route);
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user