diff --git a/README.md b/README.md index ecce0d1..838d929 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,26 @@ The starter doesn't require the use of any backends. Once deployed, you will hav The template uses TypeScript to compile source files in `./src` into JS files in `./build`, which are then wrapped into `./bin/index.wasm` using the `js-compute-runtime` CLI tool bundled with the `@fastly/js-compute` npm package, and bundled into a `.tar.gz` file ready for deployment to Compute. +## Running the application + +To create an application using this starter kit, create a new directory for your application and switch to it, and then type the following command: + +```shell +npm create @fastly/compute@latest -- --language=typescript --default-starter-kit +``` + +To build and run your new application in the local development environment, type the following command: + +```shell +npm run start +``` + +To build and deploy your application to your Fastly account, type the following command. The first time you deploy the application, you will be prompted to create a new service in your account. + +```shell +npm run deploy +``` + ## Security issues Please see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues. diff --git a/package.json b/package.json index 582c305..9459fbb 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "node": "^16 || >=18" }, "devDependencies": { + "@fastly/cli": "^10.14.0", "typescript": "^5.2.2" }, "dependencies": { @@ -12,6 +13,7 @@ "scripts": { "prebuild": "tsc", "build": "js-compute-runtime build/index.js bin/main.wasm", + "start": "fastly compute serve", "deploy": "fastly compute publish" } }