// /routes/api/stuff/recents/+server.ts
async function getRecentStuff() {...}
async function getUserProfile(event) {...}
export const GET: RequestHandler = async (event) => {
const mongoUser = await app.logIn(credentials);
const mongoClient = mongoUser.mongoClient('mongodb');
const userProfile = await getUserProfile(event)
const recentStuff = await getRecentStuff(mongoClient, userProfile);
return json(recentStuff);
};
// /routes/api/stuff/recents/+server.ts
async function getRecentStuff() {...}
async function getUserProfile(event) {...}
export const GET: RequestHandler = async (event) => {
const mongoUser = await app.logIn(credentials);
const mongoClient = mongoUser.mongoClient('mongodb');
const userProfile = await getUserProfile(event)
const recentStuff = await getRecentStuff(mongoClient, userProfile);
return json(recentStuff);
};