Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Web Development with MongoDB and Node
Web Development with MongoDB and Node

Web Development with MongoDB and Node: Build fast web applications for handling any kind of data , Third Edition

Arrow left icon
Profile Icon Joseph D'mello Profile Icon Satheesh Profile Icon Jason Krol
Arrow right icon
€17.99 €26.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Sep 2017 330 pages 3rd Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Joseph D'mello Profile Icon Satheesh Profile Icon Jason Krol
Arrow right icon
€17.99 €26.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Sep 2017 330 pages 3rd Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Web Development with MongoDB and Node

Getting Up and Running

In this chapter, we will cover the necessary steps to set up your development environment. These will include the following:

  • Installing Node.js on your machine
  • Installing MongoDB on your machine
  • Verifying that everything is set up properly

Follow these sections carefully, as we need the development environment to be up and running before we jump into the chapters where we dive into actual coding. For the remainder of this book, it's going to be assumed that you are using either a Mac with OS X, Linux, or Windows 7/Windows 8. You will also need super user and/or administrator privileges on the computer, as you will be installing the Node and MongoDB server. The code and examples after this chapter will all be OS agnostic and should work in any environment, assuming you have taken the steps I outlined earlier to be prepared ahead of time.

You will need...

Installing Node.js

The Node.js installer can be easily obtained by visiting the official Node website and accessing the downloads section. Once there, be sure to download the correct version depending on your OS and CPU (32-bit or 64-bit). As an alternative, you can also use OS-specific package managers to install this. Depending on the OS you are using, just jump into the specific subsection to get more details on the steps to be followed.

You can jump into the Node.js download sections by following this link: https://nodejs.org/en/download.

Mac OS X

There is a universal installer available from the Node website specifically for OS X.

We need to follow these steps to install Node.js on a Mac:

  1. Visit the download page of the...

Installing MongoDB

MongoDB can also be easily downloaded by visiting the official MongoDB website and accessing the downloads section from http://www.MongoDB.org/downloads. Once there, be sure to download the correct version depending on your OS and CPU (32-bit or 64-bit).

For Windows users, you can opt to download the MSI installer file, which will make the installation much simpler.

Depending on the version of MongoDB you downloaded, you will want to replace <version> in the following sections with the appropriate version number that matches your file.

Mac OS X installation instructions

If you are using the Homebrew package manager, MongoDB can be installed using the following two commands:

    $ brew update
    $...

Writing your first app

Now that you have everything installed and confirmed that it's all working, you can write your first quick app that will use both Node and MongoDB. This will prove that your environment is good to go, and that you're ready to get started. In addition, it will give you a brief taste of the world of Node and MongoDB development! Don't worry if a lot of the following is confusing or just doesn't make sense to you, it will all be made clear throughout the rest of the book!

To begin with, we need to create a folder for our application where this application's specific code will reside, as follows:

    $ mkdir testapp
    $ cd testapp

Creating the sample application

The testapp folder...

Adding the application code

Now, let's write the simple application code to test things out. This app is going to basically connect to our locally running MongoDB server, insert a few records as seed data, and then provide the output on whether or not the data was inserted properly into MongoDB. You can download a Gist of the code via this URL: http://bit.ly/1JpT8QL.

Using your editor of choice, create a new file named app.js and save it to the application root, which is the testapp folder. Just copy the content of the preceding Gist on to the app.js file.

Understanding the code

Now, let's go through and explain what each section of the code is doing.

    //require the mongoClient from MongoDB module 
    var MongoClient...

Summary

In this chapter, we took time to make sure your development environment was properly configured with both the Node runtime environment and the MongoDB server. After making sure both were properly installed, we wrote a basic app that utilized both technologies. The app connected to a locally running MongoDB server, and inserted sample records.

Now that the tedious but necessary tasks of setup and installation are out of the way, we can move on to some fun and start learning!

In the next chapter, we will review a primer on the JavaScript language and understand the basics of Node. Then, we will review the basic CRUD (create, read, update, delete) operations with MongoDB using the Mongo shell.

Left arrow icon Right arrow icon

Key benefits

  • 1. Learn the new ECMAScript along with Node 8 and MongoDB to make your application more effective.
  • 2. Get the up-to-date information required to launch your first application prototype using the latest versions of Node.js and MongoDB.
  • 3. A practical guide with clear instructions to designing and developing a complete web application from start to finish using trending frameworks such as angular4 and hapi

Description

Node.js builds fast, scalable network applications while MongoDB is the perfect fit as a high-performance, open source NoSQL database solution. The combination of these two technologies offers high performance and scalability and helps in building fast, scalable network applications. Together they provide the power for manage any form of data as well as speed of delivery. This book will help you to get these two technologies working together to build web applications quickly and easily, with effortless deployment to the cloud. You will also learn about angular 4, which consumes pure JSON APOIs from a hapi server. The book begins by setting up your development environment, running you through the steps necessary to get the main application server up-and-running. Then you will see how to use Node.js to connect to a MongoDB database and perform data manipulations. From here on, the book will take you through integration with third-party tools to interact with web apps. You will see how to use controllers and view models to generate reusable code that will reduce development time. Toward the end, the book supplies tests to properly execute your code and take your skills to the next level with the most popular frameworks for developing web applications. By the end of the book, you will have a running web application developed with MongoDB, Node.js, and some of the most powerful and popular frameworks.

Who is this book for?

The book is designed for JavaScript developers of any skill level who want to get up-and-running using Node.js and MongoDB to build full-featured web applications. A basic understanding of JavaScript and HTML is the only prerequisite for this book.

What you will learn

  • Work with Node.js building blocks
  • Write and configure a web server using Node.js powered by the Express.js framework
  • Build dynamic HTML pages using the Handlebars template engine
  • Persist application data using MongoDB and Mongoose ODM
  • Test your code using automated testing tools such as the Mocha framework
  • Automate test cases using Gulp
  • Reduce your web development time by integrating third-party tools for web interaction.
  • Deploy a development environment to the cloud using services such as Heroku, Amazon Web Services, and Microsoft Azure
  • Explore single-page application frameworks to take your web applications to the next level

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 29, 2017
Length: 330 pages
Edition : 3rd
Language : English
ISBN-13 : 9781788394772
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 29, 2017
Length: 330 pages
Edition : 3rd
Language : English
ISBN-13 : 9781788394772
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 104.97
Web Development with MongoDB and Node
€32.99
Mastering  Node.js
€41.99
Mastering MongoDB 3.x
€29.99
Total 104.97 Stars icon

Table of Contents

12 Chapters
Welcome to JavaScript in the Full Stack Chevron down icon Chevron up icon
Getting Up and Running Chevron down icon Chevron up icon
Node and MongoDB Basics Chevron down icon Chevron up icon
Introducing Express Chevron down icon Chevron up icon
Templating with Handlebars Chevron down icon Chevron up icon
Controllers and View Models Chevron down icon Chevron up icon
Persisting Data with MongoDB Chevron down icon Chevron up icon
Creating a RESTful API Chevron down icon Chevron up icon
Testing Your Code Chevron down icon Chevron up icon
Deploying with Cloud-Based Services Chevron down icon Chevron up icon
Popular Node.js Web Frameworks Chevron down icon Chevron up icon
Single Page Applications with Popular Frontend Frameworks Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
D. Wallace Mar 06, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Somewhat dated, but an excellent book. Very well written. Great starter material for a fledgling web developer.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.