Today we are going to take a look at how we can save data to a mongo database using mongoose. By using mongoose, we are able to model data in our application very cleanly and abstract away low-level mongo operations. Mongoose also gives us the ability to model the data in our applications easily. We…
When prototyping webapps and mobile apps, you will find the need to spin up servers that integrate with external API’s. Most of the time, this can be a huge time-suck. In the NodeJS world, express is the framework many use to setup their NodeJS server. Setting up an express server, configuring routes, and enabling CORS…
When starting a new Ionic 2 app, you may encounter a peculiar error which tells you that npm install could not be found, followed by some gibberish.
Deploying your ionic app to either heroku or aws is a breeze and takes just a few steps. 1. Install express 2. Create an app.js 3. Update your npm start script. Let’s get started 1. Install Express You can install
This example is an extension of the previous post on push notifications. We are going send a push notification through a NodeJS/Parse server by invoking an http request in our ionic app. In order to send a push notification we need to
In the last example, we configured passport to authenticate users with a username and password. This post will show how to authenticate users using passport and facebook in sails. We’ll extend what we did in the last example, leaving the local login endpoints intact. The first thing we’ll need to do is create a facebook…
The goal of this article is to explain how to integrate passport with the popular nodejs framework sailsjs. Many articles simply spit out code and do not explain what is going on under the covers, making it a struggle to understand the way passport and sails js work. This will be the first of
Sails js is a NodeJS framework that allows developers to build web applications on top of Node. There is a nice community around sails that has contributed to a very powerful set of sails plugins. From bower to passport integration, you can find a plugin for just about anything.
When dealing with databases in NodeJS, mongo seems to be the defacto standard. Many people don’t realize that NodeJS can integrate with databases such as mysql easily and effortlessly. Let’s take a look at how we can accomplish this using felixge’s node-mysql library.
There are two ways of writing files in NodeJS, an asynchronous way and a synchronous way. Below, we’ll show functions demonstrating both methods.