mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Add archiving system & pushing news org.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
This commit is contained in:
parent
38ce057937
commit
61f56a8c0a
2 changed files with 22 additions and 3 deletions
11
server/api/download/news-article-archive.json.ts
Normal file
11
server/api/download/news-article-archive.json.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import sql from "~/server/components/postgres";
|
||||
export default defineEventHandler(async (event) => {
|
||||
const articles = await sql`
|
||||
SELECT * FROM news_articles;
|
||||
`;
|
||||
setHeaders(event, {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Disposition": `attachment; filename="news-articles-export-${new Date().toISOString().split("T")[0]}.json"`,
|
||||
});
|
||||
return articles;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue