- 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!
推薦閱讀
- Advanced Machine Learning with Python
- Java 9 Concurrency Cookbook(Second Edition)
- Python自動化運維快速入門(第2版)
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- Programming ArcGIS 10.1 with Python Cookbook
- SQL for Data Analytics
- Visual Basic程序設計
- ASP.NET開發與應用教程
- MySQL入門很輕松(微課超值版)
- Visual Studio Code 權威指南
- Buildbox 2.x Game Development
- Python編程快速上手2
- 一覽眾山小:ASP.NET Web開發修行實錄
- Mastering Python
- Learning Perforce SCM