diff --git a/README.md b/README.md index 1efa412..cbc6693 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,26 @@ The starter doesn't require the use of any backends. Once deployed, you will hav The template uses webpack to bundle `index.js` and its imports into a single JS file, `bin/index.js`, which is then wrapped into a `.wasm` file, `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=javascript --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 7f9a2f0..a7af149 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,14 @@ "@fastly/js-compute": "^3.0.0" }, "devDependencies": { + "@fastly/cli": "^10.14.0", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" }, "scripts": { "prebuild": "webpack", "build": "js-compute-runtime bin/index.js bin/main.wasm", + "start": "fastly compute serve", "deploy": "fastly compute publish" } }