Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

[DO NOT MERGE] Compute@Edge spike #443

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
coverage

/compute@edge/node_modules
/compute@edge/bin
/compute@edge/pkg
17 changes: 17 additions & 0 deletions compute@edge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Fastly Compute@Edge test

This directory contains a definition for a Fastly [Compute@Edge](https://docs.fastly.com/products/compute-at-edge) service. The existing, VCL-based backend, is configured as a backend of this service.

The intention is to slowly migrate functionality from VCL to Compute@Edge, deploying both services in tandem after each change, and then remove the existing VCL backend once all the functionality has been migrated.

## Common tasks

- To run the test suite: `npm test`
- To start development server: `npm run serve`

## Deployment

- Install the [Fastly CLI](https://developer.fastly.com/reference/cli/)
- Create a Fastly API token with full access to the **Staging Compute@Edge Test** service (service ID `0yW7THGQHtorLIDxhrcWx4`)
- Create a Fastly CLI profile with `fastly profile create`, providing the API token you just generated
- Run `npm run deploy`
15 changes: 15 additions & 0 deletions compute@edge/fastly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file describes a Fastly Compute@Edge package. To learn more visit:
# https://developer.fastly.com/reference/fastly-toml/

language = "javascript"
manifest_version = 2
name = "govuk-fastly"
service_id = "0yW7THGQHtorLIDxhrcWx4"

[scripts]
build = "npm exec webpack && npm exec js-compute-runtime ./bin/index.js ./bin/main.wasm"

[local_server]
[local_server.backends]
[local_server.backends.origin]
url="http://localhost:3000"
Loading