Skip to content

Commit 93540fa

Browse files
authored
Merge pull request #11 from fastly/kats/cli-deps
Use @fastly/cli in the starter kit
2 parents e2e83aa + 99375e8 commit 93540fa

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ This starter is intentionally lightweight, and only requires the [`@fastly/js-co
1212

1313
The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute that can generate synthetic responses at the edge.
1414

15+
## Running the application
16+
17+
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:
18+
19+
```shell
20+
npm create @fastly/compute@latest -- --language=javascript --starter-kit=expressly
21+
```
22+
23+
To build and run your new application in the local development environment, type the following command:
24+
25+
```shell
26+
npm run start
27+
```
28+
29+
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.
30+
31+
```shell
32+
npm run deploy
33+
```
34+
1535
## Security issues
1636

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

fastly.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ manifest_version = 2
88
name = "Default starter kit for expressly"
99

1010
[scripts]
11-
build = "npm run build"
11+
build = "npm run build"
12+
post_init = "npm install"

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
"@fastly/expressly": "^2.0.0",
55
"@fastly/js-compute": "^3.0.0"
66
},
7+
"devDependencies": {
8+
"@fastly/cli": "^10.14.0"
9+
},
710
"scripts": {
811
"build": "js-compute-runtime ./src/index.js ./bin/main.wasm",
12+
"start": "fastly compute serve",
913
"deploy": "fastly compute publish"
1014
}
1115
}

0 commit comments

Comments
 (0)