- AWS Automation Cookbook
- Nikit Swaraj
- 184字
- 2021-07-02 23:00:43
Installing dependencies
[root@awsstar example-node-server]# yarn install
yarn install v0.27.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 8.18s.
Build the application by hitting yarn run build, once the build happens, we get the dist folder:
[root@awsstar example-node-server]# yarn run build
yarn run v0.27.5
$ babel lib -d dist
lib/index.js -> dist/index.js
Done in 0.43s.
[root@awsstar example-node-server]# ls
dist lib node_modules package.json test yarn.lock
[root@awsstar example-node-server]# ls dist
index.js
It's time to run the server and access the application:
[root@awsstar example-node-server]# yarn serve
yarn serve v0.27.5
$ node dist/index.js
Server running at http://127.0.0.1:1337/

Check the test case by hitting yarn test:
[root@awsstar example-node-server]# yarn test
Server running at http://127.0.0.1:1337/
Example Node Server
? should return 200
1 passing (43ms)
We can also use npm instead of yarn for building the NodeJS application. In the next example, I have used npm to build the NodeJS application using CodeBuild.
推薦閱讀
- 課課通計算機原理
- Ansible Configuration Management
- 樂高機器人:WeDo編程與搭建指南
- Design for the Future
- 手把手教你玩轉RPA:基于UiPath和Blue Prism
- 自動控制原理
- 最簡數據挖掘
- 大數據平臺異常檢測分析系統的若干關鍵技術研究
- Visual FoxPro數據庫基礎及應用
- INSTANT Heat Maps in R:How-to
- 精通數據科學:從線性回歸到深度學習
- 基于企業網站的顧客感知服務質量評價理論模型與實證研究
- Apache源代碼全景分析(第1卷):體系結構與核心模塊
- INSTANT Adobe Story Starter
- 伺服與運動控制系統設計