Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/

dist/

env/*
!env/.env.example

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 80,
"bracketSpacing": true,
"trailingComma": "all",
"semi": true,
"singleQuote": true
}
16 changes: 16 additions & 0 deletions db/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import mongoose from 'mongoose';
import { config } from '../src/config/config.js';

export const connectDB = async () => {
try {
await mongoose.connect(config.DATABASE_URL);
console.log('MongoDB connected successfully.');
} catch (error) {
console.error('MongoDB connection error:', error);
process.exit(1);
}
};

export const disconnectDB = async () => {
await mongoose.connection.close();
};
5 changes: 5 additions & 0 deletions env/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NODE_ENV=

PORT=

DATABASE_URL=
25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import js from "@eslint/js";

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2024,
sourceType: "module",
globals: {
console: "readonly",
process: "readonly",
},
},
rules: {
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"no-console": "off",
"prefer-const": "error",
"no-var": "error",
semi: ["error", "always"],
quotes: ["error", "single"],
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

biome 보시면 좋을거 같고

},
];

import js from "@eslint/js";
Loading