codestates / codestates/AnimalChat

[Error Handling๐Ÿ‘พ] server/index config.json -> jsํŒŒ์ผ๋กœ ๋ณ€๊ฒฝ์‹œ ์—๋Ÿฌ

Open
#273 0 comments 0 reactions 0 assignees View on GitHub
error
Dominant language
JavaScript
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## ์–ด๋–ค ์—๋Ÿฌ์ธ๊ฐ€์š”?
- server/index config.json -> jsํŒŒ์ผ๋กœ ๋ณ€๊ฒฝ์‹œ ์—๋Ÿฌ

## ์—๋Ÿฌ ๋ฉ”์‹œ์ง€
```jsx
ec2 ์„œ๋ฒ„ ์‹คํ–‰์‹œ
Error: Cannot find module '/home/ubuntu/AnimalChat/server/models/../config/config.json'
`

## ์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ฐฉ๋ฒ•
- ํ•ธ๋“ค๋ง ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๊ธ€์ด๋‚˜ ์ฝ”๋“œ๋กœ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.
```jsx
const config = require(__dirname + '/../config/config.json')[env];
์œ„์ฝ”๋“œ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์€ ์ฝ”๋“œ๋กœ ์ˆ˜์ •
const config = require(__dirname + '/../config/config.js')[env];
```

## ์—๋Ÿฌ ํ•ธ๋“ค๋ง์„ ์œ„ํ•ด ์ฐธ๊ณ ํ•œ ๋ ˆํผ๋Ÿฐ์Šค ๋งํฌ
[๋ธ”๋กœ๊ทธ](https://velog.io/@two_jay/9%EC%9B%94-1%EC%9D%BC%EC%9D%98-%EB%94%94%EB%B2%84%EA%B9%85-%EB%AA%A9%EB%A1%9D)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.