|
2 | 2 |
|
3 | 3 | [](https://deploy.edgecompute.app/deploy)
|
4 | 4 |
|
5 |
| -Get to know the Fastly Compute environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns. |
| 5 | +Get to know the Fastly Compute environment with a basic starter in TypeScript that demonstrates routing, simple synthetic responses and code comments that cover common patterns. |
6 | 6 |
|
7 | 7 | **For more details about other starter kits for Compute, see the [Fastly Documentation Hub](https://www.fastly.com/documentation/solutions/starters)**
|
8 | 8 |
|
9 | 9 | ## Features
|
| 10 | +* TypeScript source files |
| 11 | +* `tsconfig.json` file to use as a starting point |
10 | 12 | * Allow only requests with particular HTTP methods
|
11 | 13 | * Match request URL path and methods for routing
|
12 | 14 | * Build synthetic responses at the edge
|
13 | 15 |
|
14 | 16 | ## Understanding the code
|
15 | 17 |
|
16 |
| -This starter is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute](https://www.fastly.com/documentation/guides/compute/javascript/) and [VCL migration](https://www.fastly.com/documentation/guides/compute/migrate/) guides. |
| 18 | +This starter kit is written in TypeScript and illustrates the same features as the [Compute JavaScript default starter kit](https://github.com/fastly/compute-starter-kit-typescript-default). It is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute](https://www.fastly.com/documentation/guides/compute/javascript/) and [VCL migration](https://www.fastly.com/documentation/guides/compute/migrate/) guides. 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. |
17 | 19 |
|
18 |
| -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. |
| 20 | +The Compute JavaScript SDK [has built-in support](https://www.fastly.com/documentation/guides/compute/developer-guides/javascript/#built-in-typescript) for executing TypeScript source files that contain only erasable TypeScript syntax. In this mode, type checking is not performed. |
19 | 21 |
|
20 |
| -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. |
| 22 | +The SDK does not directly refer to the `tsconfig.json` file, but one is included to aid your IDE in coding support as well as to illustrate the recommended practice of running `tsc --noEmit` in a `prebuild` script to check for TypeScript errors, since the SDK does not perform type checking. |
21 | 23 |
|
22 | 24 | ## Running the application
|
23 | 25 |
|
|
0 commit comments