Skip to content

Commit

Permalink
Revert "ci: add typechecking for deno (remix-run#4715)" (remix-run#4856)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored and staylor committed Jan 9, 2023
1 parent 071f2a8 commit 7674449
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/remix-deno/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function defaultCacheControl(url: URL, assetsPublicPath = "/build/") {
}

export function createRequestHandler<
Context extends AppLoadContext | undefined = undefined,
Context extends AppLoadContext | undefined = undefined
>({
build,
mode,
Expand All @@ -22,11 +22,11 @@ export function createRequestHandler<
mode?: string;
getLoadContext?: (request: Request) => Promise<Context> | Context;
}) {
const handleRequest = createRemixRequestHandler(build, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return async (request: Request) => {
try {
const loadContext = await getLoadContext?.(request);
let loadContext = await getLoadContext?.(request);

return handleRequest(request, loadContext);
} catch (error: unknown) {
Expand All @@ -53,12 +53,12 @@ export async function serveStaticFiles(
cacheControl?: string | ((url: URL) => string);
publicDir?: string;
assetsPublicPath?: string;
},
}
) {
const url = new URL(request.url);
let url = new URL(request.url);

const headers = new Headers();
const contentType = mime.getType(url.pathname);
let headers = new Headers();
let contentType = mime.getType(url.pathname);
if (contentType) {
headers.set("Content-Type", contentType);
}
Expand All @@ -71,9 +71,9 @@ export async function serveStaticFiles(
headers.set("Cache-Control", defaultCacheControl(url, assetsPublicPath));
}

const filePath = path.join(publicDir, url.pathname);
let filePath = path.join(publicDir, url.pathname);
try {
const file = await Deno.readFile(filePath);
let file = await Deno.readFile(filePath);
return new Response(file, { headers });
} catch (error) {
if (error.code === "EISDIR" || error.code === "ENOENT") {
Expand All @@ -84,7 +84,7 @@ export async function serveStaticFiles(
}

export function createRequestHandlerWithStaticFiles<
Context extends AppLoadContext | undefined = undefined,
Context extends AppLoadContext | undefined = undefined
>({
build,
mode,
Expand All @@ -103,7 +103,7 @@ export function createRequestHandlerWithStaticFiles<
assetsPublicPath?: string;
};
}) {
const remixHandler = createRequestHandler({ build, mode, getLoadContext });
let remixHandler = createRequestHandler({ build, mode, getLoadContext });

return async (request: Request) => {
try {
Expand Down

0 comments on commit 7674449

Please sign in to comment.