Skip to content

Commit

Permalink
feat: 초기화 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
webplusangels committed Jan 7, 2025
1 parent edd96c5 commit 8dd3d8c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ build/

# Environment variables
.env
constants.js

# Temporal data
data/
Expand Down
15 changes: 15 additions & 0 deletions init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const fs = require('fs');
const path = require('path');

// 생성할 폴더 목록
const folders = [path.join(__dirname, 'uploads')];

// 폴더 생성 함수
folders.forEach((folder) => {
if (!fs.existsSync(folder)) {
fs.mkdirSync(folder, { recursive: true });
console.log(`폴더 생성 완료: ${folder}`);
} else {
console.log(`폴더가 이미 존재합니다: ${folder}`);
}
});
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
{
"name": "backend",
"version": "1.0.0",
"description": "커뮤니티의 백엔드 서버입니다.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3"
},
"dependencies": {
"bcrypt": "^5.1.1",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"express-session": "^1.18.1",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.11.3",
"uuid": "^11.0.3"
}
"name": "backend",
"version": "1.0.0",
"description": "커뮤니티의 백엔드 서버입니다.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js",
"init": "node init.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3"
},
"dependencies": {
"bcrypt": "^5.1.1",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"express-session": "^1.18.1",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.11.3",
"uuid": "^11.0.3"
}
}

0 comments on commit 8dd3d8c

Please sign in to comment.