Migrate articles to standalone endpoints
This commit is contained in:
15
src/routes/blog/articles.ts
Normal file
15
src/routes/blog/articles.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getBlogListing } from './_content'
|
||||
|
||||
export async function get({ url: { searchParams } }) {
|
||||
console.log('bloglistingparams', searchParams)
|
||||
|
||||
//Regexp for getting an optional tag and a page from the params
|
||||
const tag = undefined
|
||||
const filteredContents = await getBlogListing(tag)
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
posts: filteredContents,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user