Add Docker build

This commit is contained in:
2022-03-27 20:08:12 +02:00
parent c746325495
commit a99af2f845
16 changed files with 198 additions and 29 deletions

View File

@@ -2,10 +2,16 @@ use components::tasks_list::TasksList;
use contextswitch::Task;
use reqwasm::http::Request;
use uikit_rs as uk;
use wasm_bindgen::prelude::*;
use yew::prelude::*;
mod components;
#[wasm_bindgen(module = "/js/api.js")]
extern "C" {
fn get_api_base_url() -> String;
}
#[function_component(App)]
pub fn app() -> Html {
let tasks = use_state(Vec::new);
@@ -15,7 +21,7 @@ pub fn app() -> Html {
move |_| {
wasm_bindgen_futures::spawn_local(async move {
let fetched_tasks: Vec<Task> =
Request::get("http://localhost:8000/tasks?filter=task")
Request::get(&format!("{}/tasks?filter=task", get_api_base_url()))
.send()
.await
.unwrap() // TODO