mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-15 12:28:03 -05:00
19 lines
493 B
TypeScript
19 lines
493 B
TypeScript
|
|
import { NextApiRequest, NextApiResponse } from "next";
|
||
|
|
import { MongoClient } from "mongodb";
|
||
|
|
|
||
|
|
export default async function handler(
|
||
|
|
req: NextApiRequest,
|
||
|
|
res: NextApiResponse
|
||
|
|
) {
|
||
|
|
const server = req.query.server as string;
|
||
|
|
const client = new MongoClient(process.env.MONGO_DB as string);
|
||
|
|
await client.connect();
|
||
|
|
|
||
|
|
const db = client.db("mhsf");
|
||
|
|
const collection = db.collection("customization");
|
||
|
|
|
||
|
|
res.send({ results: await collection.findOne({ server }) });
|
||
|
|
|
||
|
|
client.close();
|
||
|
|
}
|