# VS Codespaces

## This page is outdated. Please visit here to check out [how to get started with Rust functions in Node.js with VSCode](https://www.secondstate.io/articles/getting-started-rust-nodejs-vscode/).&#x20;

In the [previous tutorial](https://cloud.secondstate.io/server-side-webassembly/getting-started), we discussed how to create and access Rust functions in Node.js apps. In this tutorial, I will show you how to experiment with development without installing any developer tools software.

![https://www.youtube.com/watch?v=j85cbNsciOs](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M7iftYxfIems1-Ze7ep%2F-M7ih1C5kjt59UNOXtDf%2FSSVM-edited-without-music.gif?alt=media\&token=60167139-f4a3-4a1c-9ba4-8a9d63438ed8)

[**Fork this GitHub repository**](https://github.com/second-state/ssvm-nodejs-starter/fork) to get started. In your fork, you can use GitHub's web UI to edit source code files.

* The Rust files are in the `src` directory. You can put high performance workload into Rust functions. The Rust build and dependency configuration is in the `Cargo.toml` file.
* The JavaScript files are in the `node` directory and they can access the Rust functions.
  * The `node/app.js` file contains the application.

### VS Codespaces steps

{% hint style="info" %}
VS Codespaces runs entirely in your browser and costs around $1 per work day. It is cheaper than a cup of coffee in the office. Alternatively, in steps 1-2 below, you could use locally installed VSCode and Docker, and [launch the IDE with your remote git repository](https://code.visualstudio.com/remote-tutorials/containers/getting-started).
{% endhint %}

First, open the [VSCode Codespaces](https://online.visualstudio.com/) web site and login with your Azure account. You can get a [free Azure account](https://azure.microsoft.com/en-us/free/).

Next, create a new codespace. Put your forked repository into the Git Repository field. This step takes a few minutes. But once a codespace is created, subsequent openings only take seconds.

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rgrDU19q3AwK5HTIT%2Fvscode_create.png?alt=media\&token=e45ff1c0-952d-48e9-9a00-997b90293685)

Open the source code files and make changes as you wish!

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rh4uRU1jlyhbgogfo%2Fvscode_code.png?alt=media\&token=bd01aa0b-c5eb-4a19-8060-f225bcb516f0)

Click on the Run button on the left panel, and then the Launch Program at the top to build and run the application.

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rhEyyc0F-Xi_QULSy%2Fvscode_run.png?alt=media\&token=47abd263-b832-4d67-bfe2-9370a34bd6a4)

The Terminal window at the bottom shows the build progress. It builds the Rust program, and then launches the Node.js app.

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rhQPQv2cLxLEUdwf3%2Fvscode_build.png?alt=media\&token=9acaf15f-cafb-4820-abbd-a430443e38de)

The Debug window shows the Node.js server running and waiting for web requests.

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rh_DgonJ4jp6rJlQj%2Fvscode_debug.png?alt=media\&token=67311334-82d7-489a-8d94-4820166cae2e)

Now, open another terminal window in the IDE via the `Terminal -> New Terminal` menu.

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rhzSfSE03tmFm5Fr3%2Fvscode_terminal.png?alt=media\&token=8cd10bf9-9c2f-40d9-98b2-a26bfeda3cd8)

From the terminal window, you can test the local server.

```
$ curl http://127.0.0.1:3000/?name=SSVM
hello SSVM
```

In fact, you can run any Linux command from VSCode's built-in Terminal. You could run `ssvmup build` to build, and then `node node/app.js` to run the Node.js application. The Node.js application could be a server application as we have shown here, or simply a command line program as many of our [later examples](https://cloud.secondstate.io/server-side-webassembly/pass-any-argument-and-return-any-value).

![](https://2059664975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkHSKFjYCdGsI47O5f9%2F-M6rg5hNFqskz1Uhbruw%2F-M6rkkwZ6dvOgEohgF67%2Fvscode_terminal_ssvm.png?alt=media\&token=3fde16dc-57d8-40ea-a85b-852c86564fe9)

That's it! VSCode has many useful features such as real time error detection and syntax highlighting as you type code, advanced Github integration, and integrations with many many development tools. Enjoy coding!
