Require on NodeJS angularJS framwork


I work on a webSite using angularJS and NodeJS and i try to connect to CosmoDB DataBase(SQL API) on AZURE like explaned here :
The problem is “require” ====> i have the error : ReferenceError: require is not defined
at http://localhost:8000/app.js:41:26

I tested with browserify but the same problem.
Please helpe me.


Please share your project name so we can take a look at your code (if it’s private, make it public or DM us a join link). Thanks.


I cloned this projects :
And I added the config.js file wich containing :
config.endpoint = “MY URI”;
config.primaryKey = “MY AZURE COSMOS KEY”;

config.database = {
“id”: “FamilyDB”

config.collection = {
“id”: “FamilyColl”

config.documents ={…}
module.exports = config;

App.js contain :

‘use strict’;
// Declare app level module which depends on views, and components

angular.module(‘myApp’, [

config([’$locationProvider’, ‘$routeProvider’, function($locationProvider, $routeProvider) {
var DocumentDBClient = require(‘documentdb’).DocumentClient;
var config = require(’./config’);


$routeProvider.otherwise({redirectTo: '/view1'});



I tried to use browserify like this : browserify -r documentdb -r ./app/app.js:documentdb > bundle.js ;
It create the bundle.js file containing require function but it don’t work…