Skip to content

Commit

Permalink
Merge pull request #61 from Gosrock/dev
Browse files Browse the repository at this point in the history
실 배포 형식으로 바꿈
  • Loading branch information
ImNM authored Feb 22, 2022
2 parents a5de8e1 + 881e439 commit a019723
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ const server = async () => {
JWT_KEY_ADMIN_ACCESS,
JWT_KEY_MESSAGE,
JWT_KEY_FRONT_ACCESS,
NODE_ENV
GOSROCK_CODE
} = process.env;
console.log(NODE_ENV);

// 코드베이스로 환경변수 있는지 체크
if (
!MONGO_URI ||
!JWT_KEY_ADMIN_ACCESS ||
!JWT_KEY_MESSAGE ||
!JWT_KEY_FRONT_ACCESS
!JWT_KEY_FRONT_ACCESS ||
!GOSROCK_CODE
)
throw new Error('환경변수가 제대로 설정되지 않음');

Expand All @@ -59,7 +59,7 @@ const server = async () => {
SocketSingleton.startSocketServer();
app.use(cors());
//DB 를 먼저 연결하고 나서 요청을 받아야 오류가 안남! 굿... 좋네여,..
// console.log("MongoDB conneted");
console.log('MongoDB conneted');
// app.disable("etag");

app.use(express.json());
Expand Down
2 changes: 1 addition & 1 deletion src/routes/RouteAdminRegister.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RouteAdminRegister.post(
try {
// 추후 phoneNumber 는 accessToken 미들웨어에서 가져올 예정입니다./
const { userId, name, password, gosrockCode } = req.body;
if (gosrockCode !== '1234') {
if (gosrockCode !== process.env.GOSROCK_CODE) {
return res.custom400FailMessage('코드오류');
}
console.log(userId, name, password);
Expand Down
14 changes: 6 additions & 8 deletions src/routes/RouteSendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ RouteSendMessage.post(

//XXXXX 문자 전송 부분입니다 실제로 사용하기 전까지 주석해제 XXXXX

// await naverMessage(
// caller,
// phoneNumber,
// `[GOSROCK] 이것은 테스트입니다 인증번호 [${authenticationNumber}]를 입력하세요`
// );
await naverMessage(
caller,
phoneNumber,
`[GOSROCK] 인증번호 [${authenticationNumber}]를 입력하세요`
);

//XXXXX 문자 전송 부분입니다 실제로 사용하기 전까지 주석해제 XXXXX

Expand All @@ -69,9 +69,7 @@ RouteSendMessage.post(
success: true,
status: 200,
data: {
messageToken: messageToken,
// 테스트 이후 제거 요망
authenticationNumber: authenticationNumber
messageToken: messageToken
}
});
} catch (err) {
Expand Down

0 comments on commit a019723

Please sign in to comment.