- install the generator
$ npm install -g strongloop
- Scaffold out an app
$ slc loopback
#MongoDB
What is mongo - document based database, no SQL How do you install it by default its not secure, you should add a user and restrict access before production
digital ocean mongo labs using mongoLabs mongo ds021671.mlab.com:21671/sdcs -u michael -p michael
const chai = require('chai'); | |
const chaiHttp = require('chai-http'); | |
const expect = chai.expect; | |
chai.use(chaiHttp); | |
const app = require('../server/app'); | |
var mock = []; | |
describe("server module", function() { |
ESLint is an open source project originally created by Nicholas C. Zakas in June 2013. Its goal is to provide a pluggable linting utility for JavaScript. Adding it to all your projects and setting up a linter plugin in your code editor may help you write more maintainable code.
Install the Atom Linter plugin
Install the Atom ES-Lint Plugin
var fs = require('fs') | |
function readfile() { | |
new Promise(function (resolve, reject) { | |
fs.readFile('app/topspots.json', 'utf-8', function (err, file) { | |
if (err) { | |
console.log('Inside Error: ') | |
console.log(err); | |
return reject(err); | |
} |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
Add something like this:
var guid = require('guid'); | |
var listeners = {}; | |
module.exports = { | |
register: function(cb) { | |
var id = guid.raw(); | |
listeners[id] = callback; | |
return id; | |
}, | |
dispatch: function(payload) { |