Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/setting server] 개발환경세팅 #31

Merged
merged 4 commits into from
Nov 2, 2021
Merged

Conversation

ddaynew365
Copy link
Collaborator

내용

  • 패키지 설치 내역
    • express
    • morgan
    • express-session
    • mysql2
  • 디렉토리 역할
    • api : 라우팅 및 개개인 미들웨어 적용
    • app.ts : 공통적인 미들웨어 적용
    • www.ts : 에러처리 및 서버 열기
    • controllers : client에게 데이터를 주고 받는 함수 처리
    • models : 데이터 처리

고민

  • typeorm vs sequelize
    • typoeorm 역시 좋은 ORM이지만 NestJS를 사용시 더 잘 맞는 느낌이 들고 단순히 Typescript만을 적용한 우리의 프로젝트에는 sequelize를 쓰는 것이 더 잘 맞는 느낌이 들어 sequelize를 선택하였다.

- 타입스크립트용 express 웹 서버 생성
- 5000번 포트 생성
- app.ts 생성
- eslint, prettier 적용
@ddaynew365 ddaynew365 added this to the 1주차 개발 마일스톤 milestone Nov 2, 2021
@ddaynew365 ddaynew365 linked an issue Nov 2, 2021 that may be closed by this pull request
@Noelsky-code
Copy link
Member

  1. Model 계층은 db를 squalize에 연결해주는 역할을 할 거 같은데 squalize 를 처리해주는 계층이 하나 더 있어야할 거 같습니다 find 같은 함수를 실행해 줄 계층 입니다
  2. 초기 설정만 잘 된다면 sequalize가 최고인거 같습니다

"host": "localhost",
"port": 3306,
"username": "test",
"password": "test",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env를 활용하는게 좋을 거 같습니다

},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"import/no-unresolved": 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react 용 eslint 인거처럼 보입니다
express에서도 이걸 사용해도 되나요?

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon ./src/www.ts"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

배포용 script가 필요해 보입니다

"semi": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier도 리액트용 prettier인 거 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
1 주차
Awaiting triage
Development

Successfully merging this pull request may close these issues.

[ BE ] Express 서버 개발 환경 세팅
3 participants