Skip to content
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Park website visitors in a virtual queue to reduce the demand on your origins during peak times.

**For more details about other starter kits for Compute@Edge, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)**
**For more details about other starter kits for Fastly Compute, see the [Fastly Developer Hub](https://developer.fastly.com/solutions/starters)**

[![A screenshot of the queue page for a ticketing website. It reads: Sometimes we have to restrict the number of people who can access our website at the same time, so that everything works properly. There are 46 people ahead of you in the queue.](screenshot.png)](https://queue-demo.edgecompute.app/index.html)

Expand All @@ -16,13 +16,13 @@ Park website visitors in a virtual queue to reduce the demand on your origins du
## Getting started

1. If you haven't already, [sign up for Upstash](https://www.npmjs.com/package/@upstash/redis) and create a Redis service.
2. Initialize a Compute@Edge project using this starter kit.
2. Initialize a Compute project using this starter kit.
```sh
fastly compute init --from=https://github.com/fastly/compute-starter-kit-javascript-queue
```
3. Create the `upstash` backend, changing the default hostname to the one provided in the Upstash console.
4. Create the `protected_content` backend by accepting the default example host or setting your own.
5. Populate the `config` dictionary by following the prompts to configure Upstash and set a secret for signing cookies.
5. Populate the `config` config store by following the prompts to configure Upstash and set a secret for signing cookies.
6. Run `fastly compute publish` to deploy your queue.

## Understanding the code
Expand All @@ -34,7 +34,7 @@ This starter is fully-featured, and requires some dependencies on top of the [`@

The starter will require a backend to be configured to send requests to once visitors have made it through the queue. For demonstration, the default is a public S3 bucket with some assets and an index page.

The template uses webpack to bundle `index.js` and its imports into a single JS file, `bin/index.js`, which is then wrapped into a `.wasm` file, `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@Edge.
The template uses webpack to bundle `index.js` and its imports into a single JS file, `bin/index.js`, which is then wrapped into a `.wasm` file, `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.

## Design

Expand Down
16 changes: 8 additions & 8 deletions fastly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ name = "Queuing / Waiting room (JS)"
override_host = "eu1-close-treefrog-37046.upstash.io"
url = "https://eu1-close-treefrog-37046.upstash.io"

[local_server.dictionaries]
[local_server.config_stores]

[local_server.dictionaries.config]
[local_server.config_stores.config]
file = "devconfig.example.json"
format = "json"

Expand All @@ -33,19 +33,19 @@ name = "Queuing / Waiting room (JS)"

[setup.backends.upstash]

[setup.dictionaries]
[setup.config_stores]

[setup.dictionaries.config]
[setup.config_stores.config]

[setup.dictionaries.config.items]
[setup.config_stores.config.items]

[setup.dictionaries.config.items.jwt_secret]
[setup.config_stores.config.items.jwt_secret]
description = "Secret for JWT signing"

[setup.dictionaries.config.items.upstash_token]
[setup.config_stores.config.items.upstash_token]
description = "Token for Upstash REST API"

[setup.dictionaries.config.items.upstash_url]
[setup.config_stores.config.items.upstash_url]
description = "URL of Upstash service (e.g. https://eu1-close-treefrog-35041.upstash.io)"

[setup.log_endpoints]
Expand Down
Loading