but the way I'm reading from process.env and passing it to the constructor should work, right?
but the way I'm reading from process.env and passing it to the constructor should work, right?
const apiKey as a global var in a ts file under packages/api/src/routes
When the schedule interval is more than 1 hour, a scheduled Worker may run for up to 15 minutes.. My job runs once per month.

#[event(fetch)]
async fn main(mut req: Request, _env: Env, _ctx: Context) -> Result<Response> {
if req.method() == Method::Post{
if let Ok(body) = req.text().await{
match serde_json::from_str::<TVSignal>(&body) {
Ok(tvs)=> {
match Fetch::Request(tvs.request()).send().await {
Ok(_) => Response::ok("Success"),
Err(_) => Response::error("Error to send request to OKX", 502),
}
},
Err(_) => Response::error("Can't deserialize json to pass value", 400),
}
}else {
Response::error("Need text body",400)
}
}else {
Response::error("There are apis, please request with POST",400)
}
}