Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- TypeScript
- JavaScript
- AWS
- game
- Nest.js
- Python
- 게임
- GIT
- nestjs
- Queue
- nodejs
- mongoose
- OCR
- jest
- 공룡게임
- class
- Bull
- 정렬
- cookie
- Sequelize
- flask
- dfs
- MongoDB
- react
- typeORM
- Dinosaur
- MySQL
- 자료구조
- Express
Archives
- Today
- Total
포시코딩
Express + TypeScript + Mongoose with. pnpm (1) - Start 본문
728x90
Create a package.json file
pnpm init
Install dependencies
pnpm i express
pnpm i -D typescript @types/express @types/node ts-node-dev
Create a tsconfig.json file
npx tsc --init
app.ts
import express, { Express, Request, Response } from 'express';
const app: Express = express();
const port = 8080;
app.get('/', (req: Request, res: Response) => {
res.send('hihi');
});
app.listen(port, () => {
console.log(`Server on`);
});
package.json
"scripts": {
"dev": "ts-node-dev --respawn --pretty --transpile-only app.ts",
},
- --respawn: 스크립트가 종료된 후에도 변경사항을 계속 확인
- --pretty: 예쁜 진단 포매터 사용 (TS_NODE_PRETTY)
- --transepile-only: TypeScript의 더 빠른 트랜스파일 모듈 사용 (TS_NODE_TRANSPILE_ONLY)
Check the result
pnpm run dev
다음 포스팅에선 MongoDB 연동에 대해 알아보자
728x90
'Node.js' 카테고리의 다른 글
[Nest] set cookie-parser (0) | 2023.09.22 |
---|---|
Express + TypeScript + Mongoose with. pnpm (2) - MongoDB Integration (2) | 2023.07.31 |
[NestJS] 다중 서버에서의 Bull, Event-Emitter - 해결중 (2) | 2023.07.17 |
[Nest.js] applyDecorators - 작성중 (0) | 2023.04.06 |
[Nest.js] passport, jwt를 통한 로그인 구현(1) - passport-local (0) | 2023.04.06 |