feat(crawler): sync local data

This commit is contained in:
2025-11-14 14:31:32 +02:00
parent 4ec2a608b1
commit 05a78913c0
9 changed files with 81 additions and 75 deletions
+1 -12
View File
@@ -12,18 +12,7 @@ import { appRouter } from "#api/trpc/routers/_app";
const app = new OpenAPIHono();
app.use(async (c, next) => {
const data = await c.req.json();
console.log("Incoming Request:", {
data: data,
headers: c.req.header,
method: c.req.method,
url: c.req.url,
});
return next();
});
app.use(logger());
app.use(secureHeaders());
app.use(
+10 -4
View File
@@ -38,10 +38,16 @@ export const createArticleSchema = z
example: "https://example.com/article",
}),
metadata: metadataSchema.optional(),
publishedAt: z.date().openapi({
description: "The publication date of the article.",
example: "2023-01-01T00:00:00Z",
}),
publishedAt: z
.string()
.refine((value) => !Number.isNaN(Date.parse(value)), {
message: "Invalid date format",
})
.transform((value) => new Date(value))
.openapi({
description: "The publication date of the article in ISO 8601 format.",
example: "2023-01-01T00:00:00Z",
}),
sourceId: z.string().openapi({
description: "The unique identifier of the source from which the article was crawled.",
example: "radiookapi.net",