Skip to content

Commit

Permalink
added gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpapa committed Nov 19, 2014
1 parent 6706c29 commit 33f8b9b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 2 additions & 0 deletions zza-node-mongo/client/app/routeStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
(function( angular ) {
'use strict';



angular.module("app")
.config(['$stateProvider', '$urlRouterProvider', configureStates]);
/////////////////////
Expand Down
3 changes: 2 additions & 1 deletion zza-node-mongo/client/app/shell/header.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
/*
* header viewmodel associated with the header.html view
* at the top of the shell.
* It displays navigation among the main app 'pages'
*/

(function(angular) {
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion zza-node-mongo/db/mongodb.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#logpath=c:\mongodb\log\mongo.log
dbpath=/Users/papaj015/_git/ng-demos/zza-node-mongo/db/zza
dbpath=/Users/john/_git/ng-demos/zza-node-mongo/db/zza-mongo-database
rest=true
14 changes: 13 additions & 1 deletion zza-node-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,28 @@
"description": "A demonstration of Breeze, MongoDb, Express, Angular, and Node.js (BMEAN)",
"version": "0.6.0",
"private": true,
"scripts": {
"start": "gulp serve-dev"
},
"dependencies": {
"body-parser": "~1.0.0",
"breeze-mongodb": "^0.0.6",
"compression": "~1.0.1",
"cors": "^2.2.0",
"debug": "~0.7.4",
"express": "^4.0.0",
"mongodb": ">1.3.0",
"mongodb": "^1.4.20",
"morgan": "~1.0.0",
"serve-static": "1.0.2",
"static-favicon": "~1.0.0"
},
"devDependencies": {
"browser-sync": "^1.5.8",
"gulp": "^3.8.10",
"gulp-load-plugins": "^0.7.1",
"gulp-nodemon": "^1.0.4",
"gulp-task-listing": "^0.3.0",
"gulp-util": "^3.0.1",
"node-inspector": "^0.7.4"
}
}
29 changes: 7 additions & 22 deletions zza-node-mongo/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ var express = require('express')
, errorHandler = require('./errorHandler')
, favicon = require('static-favicon')
, fileServer = require('serve-static')
, http = require('http')
, isDev = app.get('env') === 'development'
, logger = require('morgan')
, port = process.env["PORT"] || 3000;
, port = process.env["PORT"] || 7999;

app.use( favicon());
app.use( logger('dev'));
Expand All @@ -38,31 +37,17 @@ app.use( bodyParser()); // both json & urlencoded
// Consider 'st' module for caching: https://github.com/isaacs/st
app.use( fileServer( __dirname+'/../client' )); // was fileServer( process.cwd() )


app.use(cors()); // enable ALL CORS requests
breezeRoutes.init( app ); // Configure breeze-specific routes for REST API

// a test POST endpoint ... for the demo
if (isDev){
app.post( '/ping', function(req, res, next){
console.log(req.body);
res.send('pinged!!!');
});
}


// this middleware goes last to catches anything left
// in the pipeline and reports to client as an error
app.use(errorHandler);

// create server (in case interested in socket.io)
var server = http.createServer(app);

// Start listening for HTTP requests
server.listen(port); // app.listen( port ); // if we weren't using 'server'

console.log('env = '+ app.get('env') +
'\n__dirname = ' + __dirname +
'\nprocess.cwd = ' + process.cwd() );

console.log('\nListening on port '+ port);
app.listen(port, function() {
console.log('env = ' + app.get('env') +
'\n__dirname = ' + __dirname +
'\nprocess.cwd = ' + process.cwd() +
'\nNode Server is listening on port ' + port);
});

0 comments on commit 33f8b9b

Please sign in to comment.