@fastly/as-compute
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@fastly/as-compute", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "SEE LICENSE IN LICENSE", | ||
@@ -5,0 +5,0 @@ "main": "assembly/index.ts", |
# as-compute | ||
![npm version](https://img.shields.io/npm/v/@fastly/as-fetch) ![npm downloads per month](https://img.shields.io/npm/dm/@fastly/as-fetch) | ||
![npm version](https://img.shields.io/npm/v/@fastly/as-compute) ![npm downloads per month](https://img.shields.io/npm/dm/@fastly/as-compute) | ||
@@ -23,4 +23,5 @@ Experimental AssemblyScript SDK for building [Compute@Edge](https://www.fastly.com/products/edge-compute/serverless) applications with AssemblyScript. | ||
```typescript | ||
// Import `as-fetch` Fetch API classes and Fetchly to interact with Fastly's Compute@Edge. | ||
import { Request, Response, Headers, Fetchly } from "@fastly/as-compute"; | ||
// Import the exposed `@fastly/as-fetch`'s Fetch API classes, | ||
// and `Fastly` to interact with Fastly's Compute@Edge. | ||
import { Request, Response, Headers, Fastly } from "@fastly/as-compute"; | ||
@@ -37,4 +38,4 @@ // Create some headers for our upstream request to our origin. | ||
// Send the upstream request with `Fetchly.fetch` and wait to get our response. | ||
let upstreamResponse = Fetchly.fetch(upstreamRequest, { | ||
// Send the upstream request with `Fastly.fetch` and wait to get our response. | ||
let upstreamResponse = Fastly.fetch(upstreamRequest, { | ||
backend: "TheOrigin", | ||
@@ -53,3 +54,3 @@ }).wait(); | ||
// Send the downstream response back down to the client! :) | ||
Fetchly.respondWith(downstreamResponse); | ||
Fastly.respondWith(downstreamResponse); | ||
``` | ||
@@ -56,0 +57,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114228
72