mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
17 lines
361 B
TypeScript
17 lines
361 B
TypeScript
import sql from "~/server/components/postgres";
|
|
export default defineEventHandler(async (event) => {
|
|
try {
|
|
const fetchDataInSQL = await sql`
|
|
SELECT * FROM lt_news_org;
|
|
`;
|
|
return {
|
|
data: fetchDataInSQL,
|
|
};
|
|
} catch (e) {
|
|
console.log(e);
|
|
return {
|
|
error: "SERVER_SIDE_ERR",
|
|
elogs: e.message,
|
|
};
|
|
}
|
|
});
|