Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.47 KB

01-setup.md

File metadata and controls

56 lines (39 loc) · 1.47 KB

In this section, we will ensure that Wing is installed and functioning properly on your machine.

Prerequisites

Wing Toolchain

The Wing Toolchain is distributed via npm:

npm install -g winglang

Verify your installation:

wing --version

Wing VSCode Extension

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.

Wing it

  1. Create a new directory on your filesystem (e.g., /tmp/wing-workshop).
  2. Start VSCode from this directory.
  3. Create a backend directory.
  4. 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

🚀 In the Wing Console, you can push messages to the Queue and observe the files created in the Bucket. 🚀