2023-08-21 23:08:13 +01:00

13 lines
383 B
TypeScript

// Fetches all tags and returns a JSON Array of the tags ordered in their frequency of use
import { json } from '@sveltejs/kit';
import { mongoConnect } from '$lib/database/mongo.server';
export async function GET({ url }) {
const db = await mongoConnect();
const col = db.db('fredboniface').collection('projects');
const res = await col.find().toArray();
return json(res);
}