- Web Development with MongoDB and Node(Third Edition)
- Bruno Joseph D'mello Mithun Satheesh Jason Krol
- 142字
- 2021-07-08 10:32:42
Launching the sample app
Once you have the complete code saved to app.js, it's time to execute it and see what happens. However, before you can launch an app that clearly relies on a connection to MongoDB, you need to first boot up the MongoDB daemon instance:
$ mongod
In Windows, if you haven't set a PATH variable for mongod, you may need to use the full path while executing MongoDB, which is c:\MongoDB\bin\mongod.exe. For your needs, the remainder of this book will refer to the mongod command, but you may always need to execute the full path in each instance.
Now, to launch the app itself, execute the following command after moving to the root folder where app.js is located:
$ node app.js
When the app first executes, you should see the following:
Connected correctly to server Success :2 chapters inserted!
推薦閱讀
- 計算思維與算法入門
- Hyper-V 2016 Best Practices
- 數據結構與算法JavaScript描述
- Visual Studio Code 權威指南
- Learning iOS Security
- Learning VMware vSphere
- 從零開始學算法:基于Python
- C#網絡編程高級篇之網頁游戲輔助程序設計
- Docker on Windows
- Java EE基礎實用教程
- Python編程基礎與數據分析
- Switching to Angular 2
- Mathematica Data Visualization
- Go語言從入門到進階實戰(視頻教學版)
- Getting Started with SQL Server 2014 Administration