Skip to content

Instantly share code, notes, and snippets.

View mailtoharshit's full-sized avatar
🤔
Always Curious

Harshit Pandey mailtoharshit

🤔
Always Curious
View GitHub Profile
@ThomasBurleson
ThomasBurleson / ScriptInjection.js
Last active February 3, 2017 02:28
Script injection with Deferred/Promises (non-jQuery)
/**
* Module that implements non-jQuery script injection with Deferred/Promise support (using
* Q.js ).
*
* This deferred load notifies caller when the script is loaded... so chaining
* or post load actions is easily supported.
*
*/
( function( win, doc, $q ){
"use strict";
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');