Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use @fastly/cli in the starter kit #11

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ This starter is intentionally lightweight, and only requires the [`@fastly/js-co

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.

## 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 --starter-kit=expressly
```

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.
3 changes: 2 additions & 1 deletion fastly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ manifest_version = 2
name = "Default starter kit for expressly"

[scripts]
build = "npm run build"
build = "npm run build"
post_init = "npm install"
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"@fastly/expressly": "^2.0.0",
"@fastly/js-compute": "^3.0.0"
},
"devDependencies": {
"@fastly/cli": "^10.14.0"
},
"scripts": {
"build": "js-compute-runtime ./src/index.js ./bin/main.wasm",
"start": "fastly compute serve",
"deploy": "fastly compute publish"
}
}
Loading