Git Product home page Git Product logo

generator-express's People

Contributors

amitaibu avatar atrox avatar cesine avatar danhper avatar dependabot[bot] avatar enniodybeli avatar focalhot avatar fr3akkk avatar fritz-c avatar jariz avatar knu2xs avatar mikeerickson avatar nategood avatar nicokratky avatar nmaggioni avatar passy avatar pavelvanecek avatar pedroparra avatar petecoop avatar pparidans avatar raldred avatar sindresorhus avatar tejasmanohar avatar varemenos avatar vergissberlin avatar vinicius33 avatar vwal avatar willsteinmetz avatar yaacov avatar zolitch 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

generator-express's Issues

Cannot find module 'lodash'

Getting this error:

$ npm install generator-express
[email protected] node_modules/generator-express
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

$ yo express

Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-express/node_modules/yeoman-generator/lib/util/log.js:3:9)
    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 Module.require (module.js:364:17)

Cannot load new routes in other controllers

Hello,
The routes I add in another controller (app/controllers/search.js) doesn't take effect, although they are loaded:

var express = require('express'),
  router = express.Router(),
  db = require('../models'),
  s = require('../data/static');


module.exports = function (app) {
  app.use('/recherche', router);
  console.log('recherche.js : fonction exportée');
};


router.post('/recherche', function(req, res, next) {
  console.log('POST : ' + req);
  console.log('recherche.js : /recherche');
  res.render('index', {
    title: 'title',
    s: s  // Données statiques
  });

});

router.get('/recherche', function(req, res, next) {
  console.log('POST : ' + req);
  console.log('recherche.js : /recherche');
  res.render('index', {
    title: 'title',
    s: s  // Données statiques
  });

});

console.log('recherche.js : racine');

And I get :

$ npm start

> [email protected] start /path/to/my-project/04-source
> node index.js

recherche.js : racine
recherche.js : fonction exportée
[404 on POST]

What do you think that can be?

Add view engine options

I want to select which view engine to use when starting the project, loading in dependencies for each rather than the current default of jade

Future of Yeoman

http://www.youtube.com/watch?v=MTYZzs8ud3E

Addy mentions the future of Yeoman - being able to combine different generators together (mentions Express 👍 ) I would very much like this to happen as combining the Angularjs generator with our generator would be a dream come true for me.

How to use sequelize association in your pattern ?

In app/models folder, I have following models

airport.coffee
user.coffee

The airport.coffee has one user:

module.exports = (sequelize, DataTypes) ->

  Airport = sequelize.define 'Airport',
    name: DataTypes.STRING
    device_id: DataTypes.STRING

  Airport.hasOne User, {as: 'publisher'}
  Airport.hasOne User, {as: 'reviewer'}
  Airport.hasOne User, {as: 'templater'}

But it not work.

thanks for your help :D

Use nodemon instead of Live Reload

A typical use case when developing locally is to have an express and Angular instances running in parallel. However only one can use live reload.

So, express generator can use nodemon instead.

App crashes at startup w/ Coffeescript and MongoDB chosen

Because when scanning for models it imports JS-files, not .coffee-files. Here:

var models = glob.sync(config.root + '/app/models/*.js');

in app.js. Should be:

var models = glob.sync(config.root + '/app/models/*.coffee');

quick fix tho

CSS Preprocessors

I'd like to stick in the option of optionally installing a css preprocessor. I'd like to give the user the option of None, SASS, LESS, and Stylus. Thoughts? Concerns?

Bootstrap support

I don't know if you think it belongs in this generator, but I wrote a version that optionally sets up Bootstrap. I can clean it up as submit a pull request if you think so.

DRY up the tasks

There is a bit of repetition among the generator types (mvc and basic) in the Gruntfiles, task definitions, generators, etc.. I know I've added to this with some of the stuff that I tacked on recently. May want to explore refactoring these areas a bit to DRY things up. Especially if there are any intentions of adding more types of generators. Looks like the foundation for this is there with the "common" stuff maybe.

Thoughts? Maybe I'm overlooking something?

Update MVC routing

I currently don't like how the routing works and find that as a project grows the routes.js gets too large.

After looking at how kraken-js routes work I will be copying how they handle them and bringing them into the controllers.

Dotfiles not present after generation

Perhaps it's just a quirk of my environment, but .gitignore and .bowerrc were not generated in either Basic or MVC modes. Can someone else reproduce this?

how to deploy this kind of app

Excuse me. I'm new to grunt and yeoman.
I've tried several generators that have a keyword 'express', and this generator is exactly what I want.
But I didn't find a grunt task to build or deploy the app.
Would anyone please tell me if there is an exist way to generate everything I need to deploy on a server.

Thank you.

Update Dependencies

  • express
    • Installed: ~4.10.6 Latest: 4.11.0

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

  • jade
    • Installed: ~1.8.1 Latest: 1.9.0

Auto-generated by Node Dependency Check

  • ejs
    • Installed: ~1.0.0 Latest: 2.1.4

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

  • sequelize
    • Installed: ~1.7.9 Latest: 2.0.0-rc7

Auto-generated by Node Dependency Check

  • pg
    • Installed: ~4.1.1 Latest: 4.2.0

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

Auto-generated by Node Dependency Check

Update Dependencies

Auto-generated by Node Dependency Check

TypeError: Cannot read property 'bold' of undefined

I'm getting some errors when trying to use this generator. My environment is:

  • OS X Mountain Lion
  • node v0.10.15
  • yeoman 1.0.1

I ran:

yo express

And got the following:

TypeError: Cannot read property 'bold' of undefined
    at Object.<anonymous> (/Users/francois/Dev/transcluder.com/node_modules/generator-express/node_modules/yeoman-generator/lib/util/common.js:5:56)
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/francois/Dev/transcluder.com/node_modules/generator-express/node_modules/yeoman-generator/lib/base.js:91:26)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

Any ideas? Should I be rolling back older versions of yo perhaps?

Config more descriptive

Hi guys,

I found this project today and I already love this, extremely useful.

I think we should use a more descriptive configuration file, for example, my config is like:

development: {
    root: rootPath,
    app: {
      name: 'project-name'
    },
    port: 8080,
    db: 'mysql://root:root@localhost:8889/project-name-development'
  }

I think that we can turn this in something more auto explanatory like

development: {
    root: rootPath,
    app: {
      name: 'project-name'
    },
    express: {
        port: 8080
    },
    db: {
        username: 'root',
        password: 'root',
        port: '8889',
        database: 'project-name'
    },
    db: 'mysql://root:root@localhost:8889/project-name-development'
  }

I think this is better because in the first time I saw the config files I felt a little bit confused when I saw config/config.js and config/express.js, I thought the "config" was to set database and express for express... But... not... Then my error was set host with the same host of database... and you know, I spend some time trying to figure out what was happening

So, because it, I think a configuration file more auto explanatory or with a lot of comments like this, should be better :)

What you think about this? (Sorry for concordance errors, I'm learning English)

2.0.0

2.0.0 will bring a lot of updates the the MVC generator in particular, after my continued use of the style.

The release will add choices of view engines, databases and CSS pre-processors to allow people to get up and running faster with their setup of choice.

ReferenceError: glob is not defined

Hi,

I have a exception while starting grunt after fresh init with MVC mongo.
No errors on install with node and bower on ubuntu. Do you have an idea, what I did wrong?

[grunt-develop] > /var/www/vergissberlin/nr-soccer/app.js:13
var models = glob.sync(config.root + '/app/models/*.js');
             ^
[grunt-develop] > ReferenceError: glob is not defined
    at Object.<anonymous> (/var/www/vergissberlin/nr-soccer/app.js:13:14)
    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:906:3
>> application exited with code 8

Thank you!
André

MVC database choices

I want to add a choice of databases rather than just MongoDB. Initially I will add MySQL and PostgreSQL.

MVC model ,'app middleware' isn't enabled in routers.

I chosen 'mvc'.
controller/home.js ,I find that the 'app middleware' isn't enabled~。
For example.

router.get('/', function (req, res, next) {
    //cookie is undefined ,because the cookieParser isn't enabled~
    console.log(req.cookies);
    res.render('index', {
      title: 'example'
    });
});

I fixed,
config/express.js

  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded());
  app.use(cookieParser());
  app.use(compress());
  app.use(express.static(config.root + '/public'));
  app.use(methodOverride());
  app.use(session({name:'weifangtan',secret: 'asfsadf'}));
  app.use(function(req,res,next){
    return next();
  });
  // Add Controllers Config
  var controllersPath = __dirname.replace('config','') + '/app/controllers';
  fs.readdirSync(controllersPath).forEach(function (file) {
    if (file.indexOf('.js') >= 0) {
      require(controllersPath + '/' + file)(app);
    }
  });

app.js

//Remove!
// var controllersPath = __dirname + '/app/controllers';
// fs.readdirSync(controllersPath).forEach(function (file) {
//   if (file.indexOf('.js') >= 0) {
//     require(controllersPath + '/' + file)(app);
//   }
// });

require('./config/express')(app, config);

i18n

Would be great to have i18n already configured.

Cannot read property 'bold' of undefined when running "yo express"

node v0.10.17, yeoman-generator 0.12.3

after installing generator-express i try to run yo express and get the following:

TypeError: Cannot read property 'bold' of undefined
at Object. (/usr/local/lib/node_modules/generator-express/node_modules/yeoman-generator/lib/util/common.js:5:56)
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/generator-express/node_modules/yeoman-generator/lib/base.js:91:26)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

Thanks for any help!

Middleware Location

There should I a place for putting middleware modules, like there is for controllers and models. Probably app/middleware/.

A company I am working for needs to write a dozen or so middleware components for Express and we need to organize them. I would like to be able to tell them of a standard location to put middleware modules, but the community has not decided where these should go.

Also, each of their middleware modules is dozens of lines of code, so placing them in app/express.js is not well organized.

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.