简体   繁体   中英

Mean Stack installation

Okay I have been working on getting a mean stack started on cloud 9 but have run into many issues.

  1. Do I use Mean.io/ Meanjs.org/ or do I personally install the mongo/express/angular/nodejs myself.

  2. What are the differences +'s and -'s to each. I am trying to make a Portfolio page for myself so I will try to use everything the stack has to offer.

I have seen installs tutorials for ubuntu but I can't find any new tutorials. Everything seems to be 2014 or early 2015. Many of the steps in tutorials no longer work the same as they did in the tutorials.

  1. Can someone explain the file structure of Mean stack? What is useful and not useful. I ended up getting mean on cloud 9 after many issues but it has an app already on it and it seems to just be the Meanjs home page. What do I need to get rid of and what do I need to keep in order to start from scratch.

I am brand new to mean but have used and know all of the stack pieces except express. I am used to Meteor which is essentially the same but need to learn Mean for a job. I prefer meteor for its simplicity but I believe Mean is more important since you have more control.

Edit

I ended up getting a job with MEAN stack and currently work with it daily. I like the generators but I think starting with generators is great but making it from scratch really get's me learning. I hope to make my own generator.

If you are new with the MEAN stack I recommend you to use: https://github.com/angular-fullstack/generator-angular-fullstack

It's an MEAN generator for yeoman: http://yeoman.io/

The scaffolding and everything is explained there.

I also create MEAN stack with the yoeman like this:

For Example, for phones project(client): c:\\mean\\phones\\client

  1. c:\\mean\\phones\\npm install -g yo
  2. c:\\mean\\phones\\client\\npm install -g gulp generator-gulp-angular // angular with gulp generator
  3. c:\\mean\\phones\\client\\yo gulp-angular //it starts the install wizard
  4. Install Restangular to communicate between client and server like so:
    bower install --save restangular
  5. c:\\mean\\phones\\client\\gulp serve it starts an http server to show the angular page

Server side: c:\\mean\\phones\\server

  1. c:\\mean\\phones\\server\\ npm install --save express install express
  2. c:\\mean\\phones\\server\\ npm install --save mongoose install mongoose
  3. c:\\mean\\phones\\server\\ npm install --save node-restful
  4. c:\\mean\\phones\\server\\ npm install --save method-override
  5. c:\\mean\\phones\\server\\ npm install --save body-parser

  6. Create automatically a node express project like so: c:\\mean\\phones\\server\\express my-project

  7. You can start the server like so: nodemon , so that on your every change it will restart

Last but not least you have to be careful how the restangular communicates with the node server in order to fetch/delete/update etc data, into your index.config.js :

   function config($logProvider, toastrConfig, RestangularProvider) {
    //set the base url of the rest api server
    RestangularProvider.setBaseUrl('http://localhost:3000');
    // Enable log
    $logProvider.debugEnabled(true);
  }

})();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM