bring cloud;
bring sim;
class Backend impl sim.IResource {
bucket: cloud.Bucket;
new() {
this.bucket = new cloud.Bucket();
}
pub inflight store(key: str, value: str) {
this.bucket.put(key, value);
}
pub inflight onStop() {}
}
class Client {
resource: sim.Resource;
new() {
let backend = new Backend();
this.resource = new sim.Resource(inflight () => {
return backend;
});
}
pub inflight store(key: str, value: str) {
this.resource.call("store", Json ["k1", "v1"]);
}
}
let client = new Client();
test "store" {
client.store("k1", "v1");
}
This happened:
[ERROR] store | Error: Missing environment variable: BUCKET_HANDLE_a2a9c469
[ERROR] store | Error: Resource is not running (it may have crashed or stopped)
I expected this:
No response
Is there a workaround?
No response
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes
Please vote by adding a 👍 reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.
I tried this:
This happened:
I expected this:
No response
Is there a workaround?
No response
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes