// 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);
}
