Skip to content

Commit b5a01d4

Browse files
authored
Merge pull request #17 from fastly/kats/cli-deps
Use @fastly/cli in the starter kit
2 parents 4916f81 + 4c5500b commit b5a01d4

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ The starter doesn't require the use of any backends. Once deployed, you will hav
1919

2020
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.
2121

22+
## Running the application
23+
24+
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:
25+
26+
```shell
27+
npm create @fastly/compute@latest -- --language=typescript --default-starter-kit
28+
```
29+
30+
To build and run your new application in the local development environment, type the following command:
31+
32+
```shell
33+
npm run start
34+
```
35+
36+
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.
37+
38+
```shell
39+
npm run deploy
40+
```
41+
2242
## Security issues
2343

2444
Please see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"node": "^16 || >=18"
55
},
66
"devDependencies": {
7+
"@fastly/cli": "^10.14.0",
78
"typescript": "^5.2.2"
89
},
910
"dependencies": {
@@ -12,6 +13,7 @@
1213
"scripts": {
1314
"prebuild": "tsc",
1415
"build": "js-compute-runtime build/index.js bin/main.wasm",
16+
"start": "fastly compute serve",
1517
"deploy": "fastly compute publish"
1618
}
1719
}

0 commit comments

Comments
 (0)