學習 NESTJS feat Part 1 ===  --- ###### tags: `Nestjs`,`TypeScript`,`TypeORM`,`Project` ## 設置 在設置的時候如有不明白的地方或者想更快地學習更多, 可以先參考設置方式: [中文版](https://www.nestjs.com.cn/) [英文版](https://nestjs.com/) 如果是專案架構一開始就打算使用Nest和第一次使用,建議先安裝CLI會比較方便。 [NestCLI](https://docs.nestjs.com/cli/overview) ### 建立檔案 * 1. 打開CMD / Mac Terminal * 2. `nest new myDocumentName` * 3. 可以選擇是否要npm 還是 Yarn 還是其他的。 ### 新增 TypeORM 和利用CLI建立檔案 - `npm install @nestjs/typeorm typeorm sqlite3` - `nest g module reports` - `nest g module users` - `nest g service reports` - `nest g service users` - `nest g controller reports` - `nest g controller users` 如果發現以上nest 的建立并沒有任何效果,這時候就要檢查自己的package.json是否有安裝cli。 - `npm install @nestjs/cli` ### 瞭解什麽是TypeORM 它可以運行在 Nodejs , Browser, Cordova , PhoneGap , Ionic , RN , Expo , Electron 平臺上,可以與TypeScript 和 JS 一起使用。 其實拆開名字就能更容易瞭解,這是一種Typescript + ORM 的運用插件。 關於 ORM 大家可以到我覺得講解的很棒的文章瞭解更多 [ORM](https://ithelp.ithome.com.tw/articles/10207752)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up