feat: trying to add hashes to scripts
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { AccessDeniedError, BadRequestError } from "@lib/errors.ts";
|
||||
import { createStreamResponse, isValidUrl } from "@lib/helpers.ts";
|
||||
import * as openai from "@lib/openai.ts";
|
||||
import { createLogger } from "@lib/log/index.ts";
|
||||
import recipeSchema from "@lib/recipeSchema.ts";
|
||||
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
|
||||
import { safeFileName, toUrlSafeString } from "@lib/string.ts";
|
||||
import { fileExtension, safeFileName, toUrlSafeString } from "@lib/string.ts";
|
||||
import { parseJsonLdToRecipeSchema } from "./parseJsonLd.ts";
|
||||
import z from "zod";
|
||||
import { createResource } from "@lib/marka/index.ts";
|
||||
import { webScrape } from "@lib/webScraper.ts";
|
||||
import { RecipeResource } from "@lib/marka/schema.ts";
|
||||
import { define } from "../../../../utils.ts";
|
||||
|
||||
const log = createLogger("api/article");
|
||||
|
||||
@@ -93,8 +92,9 @@ async function processCreateRecipeFromUrl(
|
||||
streamResponse.send({ type: "finished", url: id });
|
||||
}
|
||||
|
||||
export const handler: Handlers = {
|
||||
GET(req, ctx) {
|
||||
export const handler = define.handlers({
|
||||
GET(ctx) {
|
||||
const req = ctx.req;
|
||||
const session = ctx.state.session;
|
||||
if (!session) {
|
||||
throw new AccessDeniedError();
|
||||
@@ -120,4 +120,4 @@ export const handler: Handlers = {
|
||||
|
||||
return streamResponse.response;
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user