Skip to content
Open
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
10 changes: 5 additions & 5 deletions documentation/app/c-at-e-file-server.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import parseRange from 'range-parser'

/**
* Attempt to locate the requested resource from a Fastly Object-Store,
* If the request is a GET or HEAD request and a resource was found in the Object-Store, this will return a `Response`.
* If request is not GET or HEAD, or no resource was found in the Object-Store, this will return `null`
* @param {string} store_name The name of the Fastly Object-Store to search within.
* @param {Request} request The request to attempt to match against a resource within the Object-Store.
* Attempt to locate the requested resource from a Fastly KV Store,
* If the request is a GET or HEAD request and a resource was found in the KV Store, this will return a `Response`.
* If request is not GET or HEAD, or no resource was found in the KV Store, this will return `null`
* @param {string} store_name The name of the Fastly KV Store to search within.
* @param {Request} request The request to attempt to match against a resource within the KV Store.
* @returns {Promise<Response | null>} Returns a `Response` if a resource was found, else returns `null`.
*/
export async function get(store_name, request) {
Expand Down
6 changes: 1 addition & 5 deletions documentation/app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

import { get } from "../c-at-e-file-server.js";
import { env } from "fastly:env";
import { KVStore } from "fastly:kv-store";

// Pending update to https://github.com/JakeChampion/compute-file-server/commit/58bdcd4a6234bba5b74502f5f03bcaffabc7ad02
globalThis.ObjectStore = KVStore;

addEventListener("fetch", (event) => event.respondWith(app(event)));

Expand All @@ -24,4 +20,4 @@ async function app(event) {
console.error(error);
return new Response(error.message + '\n' + error.stack, { status: 500 })
}
}
}
Loading