feat(crawler): sync local data
This commit is contained in:
+1
-12
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user