{
1.0.0
|
- MIT License
+ MIT {{ t("app.license") }}
|
{{ new Date().getFullYear() }} © yh
diff --git a/pages/home.vue b/pages/home.vue
index 213d8fe..de200c2 100644
--- a/pages/home.vue
+++ b/pages/home.vue
@@ -79,7 +79,7 @@ onMounted(() => {
🤔
Why?
台灣的新聞是要痲是來自中國控制的媒體,或是來自只想獲得點閱的記者。{{ t("home.whydes")}}
{
🧐
How?
We use web scraping to search for the latest news, and store it into
- a postgres database.{{ t("home.howdes")}}
diff --git a/server/api/getData/fetchSources.ts b/server/api/getData/fetchSources.ts
new file mode 100644
index 0000000..210ce63
--- /dev/null
+++ b/server/api/getData/fetchSources.ts
@@ -0,0 +1,25 @@
+import sql from "~/server/components/postgres";
+export default defineEventHandler(async (event) => {
+ const body = await readBody(event);
+ const query = getQuery(event);
+ /*const sources = await sql`SELECT * FROM sources`;
+ return sources;*/
+ // Fake data
+ return {
+ status: "ok",
+ data: [
+ {
+ id: 1,
+ title: "Source 1",
+ url: "https://source1.com",
+ description: "Description for Source 1",
+ },
+ {
+ id: 2,
+ title: "Source 2",
+ url: "https://source2.com",
+ description: "Description for Source 2",
+ }
+ ]
+ }
+})
\ No newline at end of file