Giter Site home page Giter Site logo

scotch-io / node-todo Goto Github PK

View Code? Open in Web Editor NEW
723.0 60.0 1.4K 61 KB

A simple Node/MongoDB/Angular todo app

Home Page: https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular

License: MIT License

JavaScript 68.27% HTML 31.73%

node-todo's Introduction

Node Todo App

A Node app built with MongoDB and Angular. For demonstration purposes and a tutorial.

Node provides the RESTful API. Angular provides the frontend and accesses the API. MongoDB stores like a hoarder.

Requirements

  • Node and npm
  • MongoDB: Make sure you have your own local or remote MongoDB database URI configured in config/database.js

Installation

  1. Clone the repository: git clone [email protected]:scotch-io/node-todo
  2. Install the application: npm install
  3. Place your own MongoDB URI in config/database.js
  4. Start the server: node server.js
  5. View in browser at http://localhost:8080

Tutorial Series

This repo corresponds to the Node Todo Tutorial Series on scotch.io

Each branch represents a certain tutorial.

Happy Todo-ing!

Todo-aholic

node-todo's People

Contributors

caionitro avatar darynmitchell avatar gbarosio avatar jsonrice avatar nitin42 avatar xuefeng-zhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-todo's Issues

routes.js points to incorrect location for index.html

In the routes.js file, the app tries to load index.html, but it's looking in __dirname + '/public/index.html'.

__dirname is proj_root/app/, so proj_root/app/public/index.html is a 404.

Because server.js sets the static file location, you should be able to use that.

vulnerability found

# npm audit
                                                                                
                       === npm audit security report ===                        
                                                                                
# Run  npm install [email protected]  to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change
                                                                                
  Low             Regular Expression Denial of Service                          
                                                                                
  Package         debug                                                         
                                                                                
  Dependency of   mongoose                                                      
                                                                                
  Path            mongoose > mquery > debug                                     
                                                                                
  More info       https://nodesecurity.io/advisories/534                        
                                                                                


found 1 low severity vulnerability in 198 scanned packages
  1 vulnerability requires semver-major dependency updates.

?mongod

ch-nb-1614:node-todo jbrown$ node server.js
App listening on port 8080

/Users/jbrown/Documents/Repos/node-todo/node_modules/mongodb/lib/server.js:265
        process.nextTick(function() { throw err; })
                                      ^
MongoError: failed to connect to server [localhost:27017] on first connect
    at null.<anonymous> (/Users/jbrown/Documents/Repos/node-todo/node_modules/mongodb-core/lib/topologies/server.js:325:35)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)
    at null.<anonymous> (/Users/jbrown/Documents/Repos/node-todo/node_modules/mongodb-core/lib/connection/pool.js:270:12)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (/Users/jbrown/Documents/Repos/node-todo/node_modules/mongodb-core/lib/connection/connection.js:173:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at emitErrorNT (net.js:1253:8)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

Anyone knows something about this error? Thanks!

~/projects/tutorials/yournewapp $ node server.js
App listening on port 8080
events.js:141
throw er; // Unhandled 'error' event
^

Error: connection closed
at null. (/home/pat/projects/tutorials/yournewapp/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:592:24)
at emitNone (events.js:67:13)
at emit (events.js:166:7)
at null. (/home/pat/projects/tutorials/yournewapp/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:155:15)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket. (/home/pat/projects/tutorials/yournewapp/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:494:12)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at TCP._onclose (net.js:487:12)

How to user $scope in Service

$scope.copylineItem = function() {     
var copylineItems = $filter('filter')($scope.panelsObj, {
isSelected: true
});
var primaryLineNo = [];
for (var i = 0; i < copylineItems.length; i++) {
primaryLineNo.push(copylineItems[i].primaryLineNo);
}
if (primaryLineNo.length > 0) {
cfpLoadingBar.start();
APTS_PanelConfigController.cloneLineItems(cartId, primaryLineNo, function(result, event) {
if (event.status) {
if (result) {
$scope.panelsObj.splice(0, $scope.panelsObj.length);
$scope.getRules();
cfpLoadingBar.complete();
}
} else if (event.type === 'exception') {
alert(event.message);
} else {
alert(event.message);
}
});
}
};
This is my controller function i wan to transfer this function to service how can i do this and how to use scope in service

Just a question:

Is there something I am missing in setting up a DB on modulus? I created an account and seemingly went through all the steps... and this is my URL:

mongoose.connect('mongodb://<user>:<pwd>@apollo.modulusmongo.net:27017/esazO3hy');

But still get no response - yet connecting to yours does load fine.

Thanks for your help!

js-bson : Module not found

lol2

After clone running the application throws above mentioned thing.
OS: Ubuntu 14.04
NodeJs: v0.10.25 [Installed before the application cloning]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.