c-at-e-file-server
/
0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3
c-at-e-file-server 0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3
Install from the command line:
Learn more about npm packages
$ npm install @jakechampion/c-at-e-file-server@0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3
Install via package.json:
"@jakechampion/c-at-e-file-server": "0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3"
About this version
JavaScript library used to serve files from Fastly Object Store.
It is ideal for serving files built from a static site generator such as 11ty.
npm install c-at-e-file-server
Retrieve a file from a Fastly Object Store.
Returns: response
or null
Type: string
The name of the Fastly Object Store to search within.
Type: request
The request to search for a corresponding response for.
Important:
- If the request path ends in
/
, thenindex.html
is appended to the path when searching the Object Store- If the request path does not have an extension, then
index.html
is appended to the path when searching the Object Store
import { get } from "c-at-e-file-server";
async function app(event) {
const response = await get('site', request);
if (response) {
return response
} else {
return new Response(null, { status: 404 });
}
}
addEventListener("fetch", event => event.respondWith(app(event)));
Details
- c-at-e-file-server
- JakeChampion
- over 1 year ago
- MIT
- 2 dependencies
Assets
- c-at-e-file-server-0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0
Recent versions
View all- 0.0.0-328a82727842f85a573d0a2b62981c68e62483be
- 0.0.0-58bdcd4a6234bba5b74502f5f03bcaffabc7ad02
- 0.0.0-36d1569fee3ad940e3af99af96aa94eb4e1cda77
- 0.0.0-b7c002ae97c6ba55c6aae4dbaff7d403515dedd3
- 0.0.0-8831243ae720949b9ebe528bc14ad092dbb642de
- 0.0.0-ee886d1698b46103f077ca26c8eb5d986fa6236f
- 0.0.0-6036a89de4260528f87d800a1675aa7f89ebf80d
- 0.0.0-7eb6945079fae7e1c13d7e67c4a036fff7ee0b06
- 0.0.0-186b313d72422dc1c88c72456df0e67ce6156ef5
- 0.0.0-f06dec8fab69b9d4c1b09c7a4e9947db28ea8fcc