In this section, we will ensure that Wing is installed and functioning properly on your machine.
The Wing Toolchain is distributed via npm:
npm install -g winglang
Verify your installation:
wing --version
The Wing VSCode Extension adds syntax highlighting and other conveniences for the Wing Programming Language in VSCode.
To install the Wing VSCode extension, download it from the VSCode Marketplace.
- Create a new directory on your filesystem (e.g.,
/tmp/wing-workshop
). - Start VSCode from this directory.
- Create a
backend
directory. - Create
backend/main.w
with the following content:
bring cloud;
let queue = new cloud.Queue();
let bucket = new cloud.Bucket();
let counter = new cloud.Counter();
queue.setConsumer(inflight (body: str): void => {
let next = counter.inc();
let key = "key-{next}";
bucket.put(key, body);
});
Verify that the Wing toolchain is working as expected:
wing run backend/main.w