feat: store documents in sqlite
This commit is contained in:
9
routes/api/cache/index.ts
vendored
9
routes/api/cache/index.ts
vendored
@ -1,9 +0,0 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import * as cache from "@lib/cache/cache.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async DELETE() {
|
||||
await cache.clearAll();
|
||||
return new Response("OK");
|
||||
},
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
import { FreshContext, Handlers } from "$fresh/server.ts";
|
||||
import * as cache from "@lib/cache/image.ts";
|
||||
import { getImageContent } from "@lib/image.ts";
|
||||
import { SILVERBULLET_SERVER } from "@lib/env.ts";
|
||||
import { createLogger } from "@lib/log.ts";
|
||||
import { isLocalImage } from "@lib/string.ts";
|
||||
@ -83,7 +83,7 @@ const GET = async (
|
||||
|
||||
log.debug("Processing image request:", { imageUrl, params });
|
||||
|
||||
const image = await cache.getImageContent(imageUrl, params);
|
||||
const image = await getImageContent(imageUrl, params);
|
||||
|
||||
return new Response(image.content, {
|
||||
headers: {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HandlerContext, Handlers } from "$fresh/server.ts";
|
||||
import { FreshContext, Handlers } from "$fresh/server.ts";
|
||||
import { getMovie } from "@lib/tmdb.ts";
|
||||
import * as cache from "@lib/cache/cache.ts";
|
||||
import { json } from "@lib/helpers.ts";
|
||||
@ -12,7 +12,7 @@ const CACHE_INTERVAL = 1000 * 60 * 24 * 30;
|
||||
|
||||
const GET = async (
|
||||
_req: Request,
|
||||
_ctx: HandlerContext,
|
||||
_ctx: FreshContext,
|
||||
) => {
|
||||
const id = _ctx.params.id;
|
||||
|
||||
|
Reference in New Issue
Block a user