Skip to content

Commit

Permalink
[#44] Comment: 주석 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
meoraeng committed Oct 13, 2022
1 parent bbb0d81 commit 7aa8573
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,4 @@ dist
.tern-port

# JSDoc output files
/backend/out

# Uploaded image files
/backend/public/images
/backend/out
5 changes: 4 additions & 1 deletion backend/src/loaders/multer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ dotenv.config();

const IMAGE_PATH = path.resolve('./public/images');

// 디렉토리가 없을 경우 경로에 새로운 디렉토리 추가
try {
fs.readdirSync(IMAGE_PATH);
} catch (error) {
Logger.error('❌Not exist direcotry');
fs.mkdirSync(IMAGE_PATH, { recursive: true });
}


/**
* 파일의 저장경로 및 파일이름 생성 규칙 정의
*/
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, IMAGE_PATH);
Expand Down

0 comments on commit 7aa8573

Please sign in to comment.