Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Suggestion: centralised configuration for easier project customisation #446

@ghost

Description

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions