Git Product home page Git Product logo

angular-express-train-seed's Introduction

Angular Express Train Seed

This is a starting point for making AngularJS web applications with a node.js back end. Here are some of the features:

  • organized directories for both server side and client side
  • basic user authentication using 401 responses from server
  • data persistence using mongoose

Check out the demo site here: http://angular-express-train-seed.herokuapp.com/

Order you should learn this stuff, if you don't know it already:

  1. AngularJS (http://angularjs.org/)
  2. Node.js (http://nodejs.org/)
  3. Express (http://expressjs.com/)
  4. Express Train (https://npmjs.org/package/express-train)

Since this app is using express train, start it by using the command 'train run'.
You may need to install express train globally ('npm install -g express-train').

angular-express-train-seed's People

Contributors

chris-langager avatar erin-noe-payne avatar iotaweb 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

angular-express-train-seed's Issues

Bad Request (400) Error on Page Load

I notice an error in my console on initial page load that relates to the check for a logged in user in app/public/js/lib/app.js, e.g.

    // as the app spins up, let's check to see if
    // we have an active session with the server
    $http.get('/user')
      .success(function (data) {
        $rootScope.user.username = data.username;
      })
      .error(function (data) {
      });

This is effective, but I wonder if there is a more elegant way to handle the response without generating an error on the client. I made a few attempts, but I couldn't get it to work without interfering with how the authentication scheme works (I am not that experienced).

Any ideas on an approach to fix?

/app/views/partials

Hallo

Thanks for your module.
I am writing Angularjs app and have no idea about Express-Train.
Where should I read about it?
Can you provide example of file in /app/views/partials/ folder?
Since we have /app/public/partials folder (AngularJS one) why do we need this one?

Thanks

Plain text username and password

It looks like the client is passing the username and password in clear/plain text in the headers. Anyone who can perform Man-in-the-middle attack can capture client identity.

Problem Configuring MongoDB

Hello,

Probably my error, but I'm having a bit of trouble configuring MongoDB in my local development environment.

I have Mongo running (mongod) and have created an empty DB (angular-express-train) as well as updated the default.json in config to read:

    "mongodb":{
        "uri":"mongodb://localhost:27017/angular-express-train"
    },

When I try 'train run' I get the following error:

okapi:angular-express-train rob$ train run
[express train application listening on 3000]
========================================================================================
=  Please ensure that you set the default write concern for the database by setting    =
=   one of the options                                                                 =
=                                                                                      =
=     w: (value of > -1 or the string 'majority'), where < 1 means                     =
=        no write acknowlegement                                                       =
=     journal: true/false, wait for flush to journal before acknowlegement             =
=     fsync: true/false, wait for flush to file system before acknowlegement           =
=                                                                                      =
=  For backward compatibility safe is still supported and                              =
=   allows values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:true}]      =
=   the default value is false which means the driver receives does not                =
=   return the information of the success/error of the insert/update/remove            =
=                                                                                      =
=   ex: new Db(new Server('localhost', 27017), {safe:false})                           =
=                                                                                      =
=   http://www.mongodb.org/display/DOCS/getLastError+Command                           =
=                                                                                      =
=  The default of no acknowlegement will change in the very near future                =
=                                                                                      =
=  This message will disappear when the default safe is set on the driver Db           =
========================================================================================
Exiting process due to uncaught exception!
OverwriteModelError: Cannot overwrite `Todo` model once compiled.
    at Mongoose.model (/Users/rob/dev/heroku/angular-express-train/node_modules/mongoose/lib/index.js:278:13)
    at module.exports (/Users/rob/dev/heroku/angular-express-train/app/models/Todo.js:11:21)
    at /Users/rob/dev/heroku/angular-express-train/node_modules/express-train/node_modules/nject/lib/nject.js:176:33
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/rob/dev/heroku/angular-express-train/node_modules/express-train/node_modules/underscore/underscore.js:78:11)
    at Tree.resolve (/Users/rob/dev/heroku/angular-express-train/node_modules/express-train/node_modules/nject/lib/nject.js:163:7)
    at createApplication (/Users/rob/dev/heroku/angular-express-train/node_modules/express-train/lib/app.js:89:17)
    at Object.<anonymous> (/Users/rob/dev/heroku/angular-express-train/app/index.js:3:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
okapi:angular-express-train rob$

Is this a bug or is it something I've missed in the configuration steps?

Any help greatly appreciated :)

Cheers, Rob

'node app' crashes

What I did: built a new vagrant box - precise64.
Installed node on the box.
ran npm install in the application root directory
ran node app

What I expected: The node server to start on port 3000

What happened:

Exiting process due to uncaught exception!
TypeError: Object #<Object> has no method 'start'
    at Object.<anonymous> (/vagrant/app.js:4:5)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

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.