mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
14 lines
391 B
TypeScript
14 lines
391 B
TypeScript
import mongoose, { Types } from "mongoose";
|
|
import { VisitModel } from "~/shared/schema/metrics/VisitSchema";
|
|
import fs from 'fs';
|
|
|
|
const config = useRuntimeConfig();
|
|
|
|
export default defineNitroPlugin(async nitroApp => {
|
|
try {
|
|
await mongoose.connect(config.MONGO_CONNECTION_STRING);
|
|
console.log('Database connected')
|
|
} catch (ex) {
|
|
console.error(ex);
|
|
}
|
|
}) |