Book Image

Learning Yeoman

By : Jonathan Spratley
Book Image

Learning Yeoman

By: Jonathan Spratley

Overview of this book

Table of Contents (17 chapters)
Learning Yeoman
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Modern Workflows for Modern Webapps
Index

Webapp generator solutions


When creating a generic web application using the Yeoman generator-webapp, it would be nice to have a remote server somewhere serving all the API endpoints for the app to consume. However, since JavaScript cannot simply make HTTP calls to remote domains without some type of cross-site scripting setup, having a proxy server that can integrate with the Connect server while developing will make life a lot easier. It allows you to start writing code without having to wait for the server team to set up custom proxy scripts in order to access the endpoints.

Creating a RESTful Node.js server

Problem: Your project requires RESTful API routes that map resources to a MongoDB database to perform basic CRUD (create, read, update, and delete) operations and return the results in a JSON format.

Solution: Create a Node.js server by installing Express and the jps-ds module from Chapter 7, Custom Libraries; since that module contains methods for performing CRUD operations on a MongoDB...