Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
env/*
!env/.env.example
dist
dist-ssr
*.local
Expand Down
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 'node:process';

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

export const disconnectDB = async () => {
await mongoose.connection.close();
}
3 changes: 3 additions & 0 deletions env/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=development
PORT=5001
MOGO_URI=mongodb+srv://040l28_db_user:RL5PMEw29qDWLca4@cluster0.u6icetx.mongodb.net/panda-market?appName=Cluster0
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default defineConfig([
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
Expand Down
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>11-sprint-mission-fe</title>
<title>판다마켓</title>
</head>
<body>
<div id="root"></div>
Expand Down
Loading