Skip to content

Commit

Permalink
Merge pull request #17 from fastly/kats/cli-deps
Browse files Browse the repository at this point in the history
Use @fastly/cli in the starter kit
  • Loading branch information
harmony7 authored Sep 26, 2024
2 parents 4916f81 + 4c5500b commit b5a01d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"node": "^16 || >=18"
},
"devDependencies": {
"@fastly/cli": "^10.14.0",
"typescript": "^5.2.2"
},
"dependencies": {
Expand All @@ -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"
}
}

0 comments on commit b5a01d4

Please sign in to comment.