Skip to content

Commit

Permalink
convert to JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Mar 31, 2022
1 parent 77702f9 commit c518eb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"main": "index.js",
"scripts": {
"build": "esbuild src/worker.ts --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
"build": "esbuild src/worker.js --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format",
"format": "npm run check-format -- --write",
"check": "tsc --skipLibCheck",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import { Server } from 'SERVER';
import { manifest, prerendered } from 'MANIFEST';
import * as Cache from 'worktop/cfw.cache';

import type { Module, Bindings } from 'worktop/cfw';
import type { Durable } from 'worktop/cfw.durable';

interface Environment extends Bindings {
ASSETS: Durable.Object;
}

const server = new Server(manifest);

const prefix = `/${manifest.appDir}/`;

const worker: Module.Worker<Environment> = {
/** @type {import('worktop/cfw').Module.Worker<{ ASSETS: import('worktop/cfw.durable').Durable.Object }>} */
const worker = {
async fetch(req, env, context) {
try {
let res = await Cache.lookup(req);
Expand Down

0 comments on commit c518eb4

Please sign in to comment.