15 lines
424 B
TypeScript
15 lines
424 B
TypeScript
import { fetchNewsList } from ':src/blog/mod.ts'
|
|
import { SessionHandlers } from ':src/session/mod.ts'
|
|
import { respondApi, respondApiStream } from ':src/utils.ts'
|
|
|
|
export const handler: SessionHandlers = {
|
|
GET() {
|
|
try {
|
|
const newsList = fetchNewsList('cohabit')
|
|
return respondApiStream(newsList)
|
|
} catch (error) {
|
|
return respondApi('error', error)
|
|
}
|
|
},
|
|
}
|