You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
Currently to adapt MEAN.JS as the framework for any project, one has to modify multiple files in different folders throughout the repository so as to change the name, description, server routes, home page, icons etc.
It would be nice if all definitions were centralised in one location and no other core MEAN.JS files would need modified. For example, they could be written as environment configuration, with the help of lodash to merge from one of the existing env files:
var _=require('lodash');
module.exports = _.merge(require('./development'), {
app : {
title: 'A Project',
description: 'A project based on MEAN.JS',
},
db: {
uri: 'mongodb://localhost/project-dev',
},
sessionSecret: process.env.SESSION_SECRET || 'my_secret'
});
Some properties are already defined in config/env/all.js. What's left is to absorb the rest. For example, the glob pattern './app/routes/*/.js' for matching server routes could go in. A project that doesn't need the article module would have this pattern changed to exclude it, instead of having the routes.js removed completely.
This way, base MEAN.JS files would be largely retained along with the project-specific files that are only addition to the framework. Any project taking a cut from MEAN.js would continue to benefit from MEAN project's update afterwards without having to resolve a lot of merge conflicts.
What do you guys think?
The text was updated successfully, but these errors were encountered:
This post made me think you might be interested in a study I have been doing of where people put the same types of code. Have a look here, in particular, the "Settings" code types. The main idea is that "Settings" is one type of code with multiple specificities (specific to environment, to each module, to the whole app) and sides (client/server). I put my own proposal for how to do it in the first column.
Currently to adapt MEAN.JS as the framework for any project, one has to modify multiple files in different folders throughout the repository so as to change the name, description, server routes, home page, icons etc.
It would be nice if all definitions were centralised in one location and no other core MEAN.JS files would need modified. For example, they could be written as environment configuration, with the help of lodash to merge from one of the existing env files:
var _=require('lodash');
module.exports = _.merge(require('./development'), {
app : {
title: 'A Project',
description: 'A project based on MEAN.JS',
},
db: {
uri: 'mongodb://localhost/project-dev',
},
sessionSecret: process.env.SESSION_SECRET || 'my_secret'
});
Some properties are already defined in config/env/all.js. What's left is to absorb the rest. For example, the glob pattern './app/routes/*/.js' for matching server routes could go in. A project that doesn't need the article module would have this pattern changed to exclude it, instead of having the routes.js removed completely.
This way, base MEAN.JS files would be largely retained along with the project-specific files that are only addition to the framework. Any project taking a cut from MEAN.js would continue to benefit from MEAN project's update afterwards without having to resolve a lot of merge conflicts.
What do you guys think?
The text was updated successfully, but these errors were encountered: