Appendix B. Setting up a Node.js server

 

You can run Angello one of two ways: with Firebase or Node.js. We’ll show you how to install Node.js and integrate it with Angello.

Install Node.js (with Node Package Manager, a.k.a. npm) and MongoDB

If you don’t have Node.js and npm, here are a few resources to get you started:

To install MongoDB, go to http://docs.mongodb.org/manual/installation/ and follow the directions for your specific platform.

Initialize the repo

Go to your terminal and run the following commands (after you’ve installed Git and Node.js):

cd <your-projects-folder>
git clone https://github.com/angularjs-in-action/angello-express-api
cd angello-express-api
npm install
node server.js

In a nutshell, these commands download a copy of the server code into your projects directory, install all of the necessary dependencies, and start up a server listening on http://localhost:4000.

Note

The code running on localhost:4000 is not the main Angello app; it’s only the back-end API that provides data persistence. If you want to set up the main app locally, please see appendix D.

Update EndpointConfigService.js

If you haven’t already cloned the main Angello app, you can do so by running the following commands in your terminal:

cd <your-projects-directory>
git clone https://github.com/angularjs-in-action/angello
cd angello

A note about Auth0

sitemap