Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Web Development with MongoDB and Node.js

You're reading from   Web Development with MongoDB and Node.js Build an interactive and full-featured web application from scratch using Node.js and MongoDB

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher Packt
ISBN-13 9781783987306
Length 294 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jason Krol Jason Krol
Author Profile Icon Jason Krol
Jason Krol
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Web Development with MongoDB and Node.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Welcome to JavaScript in the Full Stack FREE CHAPTER 2. Getting Up and Running 3. Node and MongoDB Basics 4. Writing an Express.js Server 5. Dynamic HTML with Handlebars 6. Controllers and View Models 7. Persisting Data with MongoDB 8. Creating a RESTful API 9. Testing Your Code 10. Deploying with Cloud-based Services 11. Single Page Applications with Popular Frontend Frameworks 12. Popular Node.js Web Frameworks Index

Index

A

  • additional resources
    • about / Additional resources
  • AngularJS
    • about / AngularJS
    • URL / AngularJS
  • anonymous function / Anonymous functions and callbacks
  • API
    • about / What is an API?
  • API endpoint
    • consuming, request used / Consuming an API endpoint using Request
  • app
    • launching / Launch the sample app
  • application
    • testing / Testing the application
    • routes, testing / Testing the routes
    • server, testing / Testing the server
    • model, testing / Testing a model
    • controller, testing / Testing a controller
    • deploying / Deploying your application
    • Nodejitsu / Nodejitsu
    • Heroku / Heroku
    • AWS / Amazon Web Services (AWS)
    • Microsoft Azure / Microsoft Azure
    • Digital Ocean / Digital Ocean
  • array.splice function / Removing data – DELETE
  • arrays / Arrays
  • asynchronous callbacks / Asynchronous callbacks
  • asynchronous JavaScript code / Asynchronous
  • async module
    • about / Introducing the async module
  • automated build task managers / Automated build task managers
  • AWS
    • about / Amazon Web Services (AWS)
    • MongoLab account, creating / Create a MongoLab account and database
    • MongoLab database, creating / Create a MongoLab account and database
    • environment, creating / Create and configure the AWS environment
    • environment, configuring / Create and configure the AWS environment
  • AWS environment
    • creating / Create and configure the AWS environment
    • configuring / Create and configure the AWS environment

B

  • Backbone.js
    • about / Backbone.js
    • URL / Backbone.js
  • Basic API server
    • creating / Creating a Basic API server
    • sample JSON data, creating / Creating sample JSON data
  • Behavior Driven Development (BDD)
    • about / Running tests with the Mocha framework
    • URL / Asserting tests with Chai.js
  • bodyParser, Connect middleware / Introducing Connect
  • Bootstrap
    • URL / Views
  • Bower.io
    • URL / Dependency management
  • Broccoli
    • URL / Automated build task managers
  • Browserify
    • about / Modularity
    • URL / Modularity

C

  • callback function / Uploading an image
  • callbacks / Anonymous functions and callbacks
  • Chai.js
    • tests, asserting with / Asserting tests with Chai.js
    • installing, as devDependency / Installing Chai.js as a devDependency
  • Chai documentation
    • URL / Asserting tests with Chai.js
  • cloud
    • versus traditional hosting / Cloud versus traditional hosting
  • code
    • writing, for app / The code
  • command-line tools
    • creating / Not just on the web
  • comment model
    • inserting / Comment – inserting a comment model
  • comments helper
    • about / The comments helper
  • comments module / The comments module
  • comments property / Displaying an image
  • comparison operators / Conditions and comparison operators
  • complete data-driven website
    • creating / What to expect from this book
  • condition statement / Conditions and comparison operators
  • ConEmu
    • URL / Environment assumptions and requirements
    • about / Environment assumptions and requirements
  • configure module
    • about / Configuration module
    • Handlebars view engine / Handlebars view engine
    • middleware, using / Using and understanding middleware
    • middleware, defining / Using and understanding middleware
    • Connect middleware / Introducing Connect
    • activating / Activating the configure module
  • connect.static() middleware / Introducing Connect
  • Connect framework
    • middleware / Introducing Connect
  • Connect middleware
    • about / Introducing Connect
    • logger(*dev*) / Introducing Connect
    • bodyParser / Introducing Connect
    • json / Introducing Connect
    • urlencoded / Introducing Connect
    • methodOverride / Introducing Connect
    • cookieParser / Introducing Connect
    • errorHandler / Introducing Connect
    / Introducing Connect
  • Content Delivery Network (CDN) / Iterating on the UI
  • controller
    • testing / Testing a controller
  • controller handler
    • adding / Adding a controller handler
  • controllers
    • about / Routers and controllers, Controllers
    • CRUD, adding / Adding CRUD to the controllers
  • cookieParser, Connect middleware / Introducing Connect
  • create, read, update, delete (CRUD)
    • about / The basics of MongoDB
  • create function / Handlebars view engine, Create – inserting an image model
    • key responsibilities / Uploading an image
  • CRUD
    • adding, to controllers / Adding CRUD to the controllers
  • CSS transpiling / CSS transpiling
  • Custom middleware
    • about / Custom middleware

D

  • data
    • inserting / Inserting data
    • updating / Updating data
    • deleting / Deleting data
  • data, DELETE requests
    • removing / Removing data – DELETE
  • data, POST requests
    • receiving / Receiving data – POST and PUT requests
  • data, PUT requests
    • receiving / Receiving data – POST and PUT requests
  • database
    • checking / Check the actual database
  • dbhost variable / The code
  • dependency management / Dependency management
  • describe block
    • about / Running tests with the Mocha framework
  • devDependencies section
    • about / Installing modules using npm
  • devDependency
    • Chai.js, installing as / Installing Chai.js as a devDependency
  • Digital Ocean
    • about / Digital Ocean
    • URL / Digital Ocean
  • document
    • inserting / Inserting a document
    • retrieving / Retrieving a document
  • DOM
    • about / Iterating on the UI
  • drop() function / Deleting data
  • Dust.js
    • URL / HTML template-rendering engines

E

  • EJS
    • URL / HTML template-rendering engines
  • else condition / Uploading an image
  • Ember.js
    • about / Ember.js
    • URL / Ember.js
  • environment
    • assumptions / Environment assumptions and requirements
    • requisites / Environment assumptions and requirements
  • errorHandler, Connect middleware / Introducing Connect
  • event driven / Event driven
  • Express.js
    • about / What is Express.js?
  • Express v4.0.0
    • migrating to / Migrating to Express v4.0.0
    • middleware, using / Using new middleware
  • external APIs
    • consuming, from Node.js / Consuming external APIs from Node.js
    • API endpoint consumption, request used / Consuming an API endpoint using Request

F

  • file IO / Networking and file IO
  • files
    • organizing / Organizing the files
  • File System (fs) / Uploading an image
  • File Transfer Protocol (FTP) / Introduction to Git
  • find() function / Querying
  • findOne function / Retrieving a document
  • first app
    • writing / Writing your first app
    • code, writing / The code
    • sample app, launching / Launch the sample app
    • database, checking / Check the actual database
  • Flatiron
    • about / Flatiron
    • URL / Flatiron
  • flow / Flow
  • frontend development tools
    • about / Frontend development tools
    • automated build task managers / Automated build task managers
    • dependency management / Dependency management
    • modularity / Modularity
    • HTML template-rendering engines / HTML template-rendering engines
    • CSS transpiling / CSS transpiling
  • frontend framework
    • need for / Why use a frontend framework?
    • TodoMVC project / The TodoMVC project
    • Backbone.js / Backbone.js
    • Ember.js / Ember.js
    • AngularJS / AngularJS
  • frontend JavaScript
    • testing / Testing and test-driven development
    • PhantomJS headless browser / PhantomJS headless browser
  • functions
    • declaring / Declaring functions
    • about / Functions are objects

G

  • GET
    • reference links / What is a RESTful API?
  • GET requests
    • responding to / Responding to GET requests
  • Git
    • about / Introduction to Git
    • URL / Introduction to Git
  • global helpers / Global helpers
  • Gravatar
    • URL / Views
    / Comment – inserting a comment model
  • Gulp
    • URL / Automated build task managers

H

  • Handlebars
    • syntax / Basic syntax for Handlebars
    • URL / HTML template-rendering engines
  • Handlebars helpers
    • about / Handlebars Helpers
    • global helpers / Global helpers
    • view-specific helpers / View-specific helpers
  • Handlebars image page template
    • updating / Updating the Handlebars image page template
  • Handlebars view engine
    • about / Handlebars view engine
    • template engines / Other template engines
  • hapi
    • about / hapi
    • URL / hapi
  • helpers
    • about / Helpers
    • comments helper / The comments helper
    • sidebar / The helper sidebar
    • troubleshooting / Troubleshooting
    • stats helper / The stats helper
    • images helper / The popular images helper
    • popular images helper / The popular images helper
  • helpers, for reusable code
    • about / Helpers for reusable code
    • sidebar module / The sidebar module
    • stats module / The stats module
    • images module / The images module
    • comments module / The comments module
    • sidebar implementation, testing / Testing the sidebar implementation
  • helper sidebar
    • about / The helper sidebar
  • helpers property / Global helpers
  • Heroku
    • about / Heroku
    • URL / Heroku
  • Homebrew
    • URL / Mac OS X installation instructions
  • home controller
    • updating / Updating the home controller
    • about / The home controller
  • HTML template-rendering engines / HTML template-rendering engines
  • HTTP verbs, REST APIs
    • GET / What is a RESTful API?
    • POST / What is a RESTful API?
    • PUT / What is a RESTful API?
    • PATCH / What is a RESTful API?
    • DELETE / What is a RESTful API?

I

  • IaaS
    • versus PaaS / Infrastructure as a Service (IaaS) versus Platform as a Service (PaaS)
  • image
    • displaying / Displaying an image
    • uploading / Uploading an image
  • image controller
    • about / The image controller
  • image controller, updating
    • about / Updating the image controller
    • image, displaying / Displaying an image
    • image, uploading / Uploading an image
  • image model
    • retrieving / Index – retrieving an image model
    • inserting / Create – inserting an image model
    • updating / Like – updating an image model
  • image property / Displaying an image
  • image removal capability
    • adding / Iterating by adding an image removal capability
  • image removal capability, adding
    • route, adding / Adding a route
    • controller handler, adding / Adding a controller handler
    • Handlebars image page template, adding / Updating the Handlebars image page template
    • jQuery, updating / Updating the jQuery
  • images helper
    • about / The popular images helper
  • images module / The images module
  • imgPloadr.io / Building a complete web application
  • index function / Index – retrieving an image model
    • controller's responsibilities / Index – retrieving an image model
  • initialize function / Routers and controllers

J

  • Jasmine, for writing tests
    • URL / Testing and test-driven development
  • JavaScript
    • about / Declaring variables
  • JavaScript Primer
    • about / A JavaScript Primer
    • variables, declaring / Declaring variables
    • functions, declaring / Declaring functions
    • objects, declaring / Declaring objects
    • functions / Functions are objects
    • anonymous function / Anonymous functions and callbacks
    • callbacks / Anonymous functions and callbacks
    • arrays / Arrays
    • condition statement / Conditions and comparison operators
    • comparison operators / Conditions and comparison operators
    • flow / Flow
    • JSON / JSON
  • Joyent
    • about / Linux installation instructions
  • Joyent GitHub wiki
    • URL / Other template engines
  • jQuery
    • updating / Updating the jQuery
  • JSON / JSON
  • json, Connect middleware / Introducing Connect
  • JSONView Chrome extension
    • using / Using the JSONView Chrome extension

K

  • Karma, for running tests
    • URL / Testing and test-driven development
  • Koa
    • about / Koa
    • URL / Koa

L

  • layouts
    • about / Layouts
  • LESS
    • URL / CSS transpiling
  • library, modules
    • URL / Node Package Manager
  • lightweight Node
    • example / Node.js changed JavaScript forever
  • Like button / Like – updating an image model
  • like function / Iterating on the UI
  • Linux, MongoDB server
    • installation instructions / Linux installation instructions
  • Linux, Node.js
    • installation instructions / Linux installation instructions
  • listen function / Server.js – where it all begins
  • logger(*dev*), Connect middleware / Introducing Connect

M

  • Mac is iTerm2
    • URL / Environment assumptions and requirements
  • Mac OS X, MongoDB server
    • installation instructions / Mac OS X installation instructions
  • Mac OS X, Node.js
    • installation instructions / Mac OS X installation instructions
  • MEAN (MongoDB, Express, Angular, and Node.js) / Digital Ocean
  • Meteor
    • about / Meteor
    • URL / Meteor
  • methodOverride, Connect middleware / Introducing Connect
  • Microsoft Azure
    • about / Microsoft Azure
    • URL / Microsoft Azure
  • middleware
    • using / Using and understanding middleware
    • defining / Using and understanding middleware
  • middleware, using
    • server/configure.js / server/configure.js
    • server/routes.js / server/routes.js
  • mkdir
    • URL / Nodejitsu
  • Mocha framework
    • tests, running with / Running tests with the Mocha framework
  • model
    • testing / Testing a model
  • Model, View, ViewModel (MVVM) / Views
  • models
    • about / Models, Defining the schema and models
  • models index file
    • about / Models index file
  • Model View Controller (MVC) / Views
  • modularity, frontend development tools / Modularity
  • modules
    • about / Require and modules
    • installing, npm used / Installing modules using npm
  • moment module / Global helpers
  • MongoDB / Node and MongoDB in the wild
    • advantages / The NoSQL movement
    • about / The basics of MongoDB
    • mongo shell / The mongo shell
    • data, inserting / Inserting data
    • querying / Querying
    • data, updating / Updating data
    • data, deleting / Deleting data
    • using, with node / Using MongoDB with Node
    • connecting to / Connecting to MongoDB
    • document, inserting / Inserting a document
    • document, retrieving / Retrieving a document
    • testing / Testing everything out so far
  • MongoDB installation
    • confirming / Confirming successful MongoDB installation
  • mongodb npm module / Using MongoDB with Node
  • MongoDB server
    • installing / Installing the MongoDB server
  • MongoDB server, installing
    • Mac OS X, installation instructions / Mac OS X installation instructions
    • Windows 7, installation instructions / Windows 7 or 8 installation instructions
    • Windows 8, installation instructions / Windows 7 or 8 installation instructions
    • Linux, installation instructions / Linux installation instructions
    • installation, confirming / Confirming successful MongoDB installation
    • online documentation, bookmarking / Bookmarking the online documentation
  • MongoDB University
    • URL / Additional resources
  • MongoLab account
    • creating / Create a MongoLab account and database
  • MongoLab database
    • creating / Create a MongoLab account and database
  • Mongoose
    • about / Introducing Mongoose
    • schemas / Schemas
    • models / Models
    • built-in validation / Built-in validation
    • static methods / Static methods
    • virtual properties / Virtual properties
    • URL / Virtual properties
    • connecting with / Connecting with Mongoose
  • mongoose object / Event driven
  • mongo shell / The mongo shell
  • Mozilla Developer Network
    • URL / Additional resources
  • Mustache
    • URL / HTML template-rendering engines

N

  • networking / Networking and file IO
  • next parameter / Custom middleware
  • Node
    • about / Node and MongoDB in the wild
    • companies, working with / Node and MongoDB in the wild
    • URL / The NodeJS core
    • MongoDB used / Using MongoDB with Node
  • node-mkdirp
    • about / Nodejitsu
  • Node.js
    • about / Node.js changed JavaScript forever, A JavaScript Primer
    • and JavaScript / Node.js changed JavaScript forever
    • asynchronous callbacks / Asynchronous callbacks
    • Node Package Manager / Node Package Manager
    • networking / Networking and file IO
    • file IO / Networking and file IO
    • command-line tools, creating / Not just on the web
    • real-time web, with Socket.io / Real-time web with Socket.io
    • URL / Installing Node.js
    • external APIs, consuming from / Consuming external APIs from Node.js
  • Node.js, installing
    • Mac OS X, installation instructions / Mac OS X installation instructions
    • Windows 7, installation instructions / Windows 7 or 8 installation instructions
    • Windows 8, installation instructions / Windows 7 or 8 installation instructions
    • Linux, installation instructions / Linux installation instructions
    • installation, confirming / Confirming successful Node.js installation
    • online documentation, bookmarking / Bookmarking the online documentation
  • Node.js installation
    • about / Installing Node.js
    • confirming / Confirming successful Node.js installation
  • Node.js Web Frameworks
    • Meteor / Meteor
    • Sails / Sails
    • hapi / hapi
    • Koa / Koa
    • Flatiron / Flatiron
  • Node API
    • URL / Additional resources
  • node app.js command / Node.js changed JavaScript forever
  • Nodejitsu
    • about / Nodejitsu
    • URL / Nodejitsu
  • NodeJS
    • about / The basics of NodeJS
    • event driven / Event driven
    • asynchronous JavaScript code / Asynchronous
    • require() function / Require and modules
    • modules / Require and modules
    • core / The NodeJS core
  • NodeJS core / The NodeJS core
  • node modules
    • stubbing, with Proxyquire / Stubbing node modules with Proxyquire
  • Node Package Manager / Node Package Manager
  • Node School
    • URL / Additional resources
  • NoSQL, using
    • advantages / The NoSQL movement
  • NoSQL movement
    • about / The NoSQL movement
    • Node / Node and MongoDB in the wild
    • MongoDB / Node and MongoDB in the wild
  • npm
    • used, for installing modules / Installing modules using npm

O

  • objects
    • declaring / Declaring objects
  • online documentation, MongoDB server
    • bookmarking / Installing the MongoDB server, Bookmarking the online documentation
  • online documentation, Node.js
    • bookmarking / Bookmarking the online documentation
  • options object / Handlebars view engine

P

  • PaaS
    • versus IaaS / Infrastructure as a Service (IaaS) versus Platform as a Service (PaaS)
  • Partial views
    • about / Partial views
  • Path (path) / Uploading an image
  • PhantomJS headless browser / PhantomJS headless browser
  • popular function / The images module
  • POST
    • reference links / What is a RESTful API?
  • Postman REST Client
    • about / Introducing Postman REST Client
    • installation instructions / Installation instructions
    • using / A quick tour of Postman REST Client
    • JSONView Chrome extension, using / Using the JSONView Chrome extension
  • pretty() function / Inserting data
  • Proxyquire
    • node modules, stubbing with / Stubbing node modules with Proxyquire
  • PUT
    • reference links / What is a RESTful API?

Q

  • querying / Querying

R

  • -R flag
    • about / Writing a test helper
  • real-time web
    • used, with Socket.io / Real-time web with Socket.io
  • refactoring / Refactoring and improvements
  • Representational State Transfer (REST) / What is a RESTful API?
  • request
    • used, for consuming API endpoint / Consuming an API endpoint using Request
  • request module
    • about / Stubbing node modules with Proxyquire
  • require() function / Require and modules
  • Require.js
    • about / Modularity
    • URL / Modularity
  • RESTful API
    • about / What is a RESTful API?
  • route
    • adding / Adding a route
  • routers
    • about / Routers and controllers
  • routes
    • testing / Testing the routes

S

  • Sails
    • about / Sails
    • URL / Sails
  • sample JSON data
    • creating / Creating sample JSON data
  • SASS
    • URL / CSS transpiling
  • schemas
    • about / Schemas, Defining the schema and models
    • datatypes / Schemas
  • seedData function / The code
  • server
    • testing / Testing the server
  • server.js
    • about / Server.js – where it all begins
    • booting up / Booting up server.js
  • server/configure.js / server/configure.js
  • server/routes.js / server/routes.js
  • showDocs function / The code
  • sidebar implementation
    • testing / Testing the sidebar implementation
  • sidebar module / The sidebar module
  • Single Page Application (SPA)
    • about / What is a Single Page Application?
    • creating / What is a Single Page Application?
  • Sinon.js
    • spies, using with / Spies and stubs with Sinon.js
    • stubs, using with / Spies and stubs with Sinon.js
  • Sinon.js library
    • URL / Spies and stubs with Sinon.js
  • site
    • requisites / Building a complete web application
  • Socket.io
    • real-time web, using with / Real-time web with Socket.io
    • about / Sails
  • Software as a Service (SaaS) / Infrastructure as a Service (IaaS) versus Platform as a Service (PaaS)
  • spies
    • with Sinon.js / Spies and stubs with Sinon.js
  • spy
    • about / Spy and stub everything!
  • static methods
    • about / Static methods
  • stats helper
    • about / The stats helper
  • stats module / The stats module
  • stub
    • about / Spy and stub everything!
  • stubs
    • with Sinon.js / Spies and stubs with Sinon.js
  • Sublime Text 3
    • URL / Environment assumptions and requirements

T

  • template engines / Other template engines
  • test
    • writing / Writing and running your first test
    • running / Writing and running your first test
    • helper, writing / Writing a test helper
  • test-driven development
    • about / Testing and test-driven development
  • Test-driven Development (TDD)
    • about / Asserting tests with Chai.js
    • URL / Asserting tests with Chai.js
  • test helper
    • writing / Writing a test helper
  • tests
    • running, with Mocha framework / Running tests with the Mocha framework
    • asserting, with Chai.js / Asserting tests with Chai.js
  • this keyword / Declaring objects
  • TodoMVC project
    • about / The TodoMVC project
    • URL / The TodoMVC project
  • tools, trade
    • tests, running with Mocha framework / Running tests with the Mocha framework
    • tests, asserting with Chai.js / Asserting tests with Chai.js
    • spies, with Sinon.js / Spies and stubs with Sinon.js
    • stubs, with Sinon.js / Spies and stubs with Sinon.js
    • node modules, stubbing with Proxyquire / Stubbing node modules with Proxyquire
  • trade
    • tools / Tools of the trade
  • traditional hosting
    • versus cloud / Cloud versus traditional hosting

U

  • UI
    • iterating on / Iterating on the UI
  • Underscore.js
    • URL / HTML template-rendering engines
  • update() function / Updating data
  • urlencoded, Connect middleware / Introducing Connect

V

  • validation / Built-in validation
  • variables
    • declaring / Declaring variables
  • var keyword / Declaring variables
  • view-specific helpers / View-specific helpers
  • view models
    • about / View models
  • views
    • about / Views
    • rendering / Rendering the views
  • Virtual Private Server (VPS) / Cloud versus traditional hosting, Digital Ocean
  • virtual properties
    • about / Virtual properties

W

  • web application
    • building / Building a complete web application
  • Windows 7, MongoDB server
    • installation instructions / Windows 7 or 8 installation instructions
  • Windows 7, Node.js
    • installation instructions / Windows 7 or 8 installation instructions
  • Windows 8, MongoDB server
    • installation instructions / Windows 7 or 8 installation instructions
  • Windows 8, Node.js
    • installation instructions / Windows 7 or 8 installation instructions
  • Windows Quick Start guide
    • URL / Windows 7 or 8 installation instructions
lock icon The rest of the chapter is locked
arrow left Previous Section
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime
Visually different images
Modal Close icon
Modal Close icon