mumsy-foundation v0.1.1
Mumsy
A generator to quickly develop node applications.
Install
Mumsy is installed globally using the following command:
npm install mumsy-foundation -gUse
Mumsy is ran from the command line inside an empty directory.
Create A Directory
mkdir mumsyproject && cd mumsyprojectRun Mumsy-Foundation
mumsy-foundationConfigure App
Mumsy uses an app configuration file that requires configuration of the app secret and database url:
// config/app.js
var express = require('express');
var app = express();
if (app.get('env') === 'development') {
var appSecret = 'yourappsecret';
} else {
// production environment variable set manually in heroku app settings
var appSecret = process.env.APPSECRET;
}
module.exports = {
'secret': appSecret
};Configure Database
Mumsy uses a database configuration file that requires configuration of the database url:
// config/database.js
var express = require('express');
var app = express();
if (app.get('env') === 'development') {
var dbUrl = 'path_to_your_mongo_db';
} else {
// production environment variable set by mongolab add-on in heroku app resources
var dbUrl = process.env.MONGOLAB_URI;
}
module.exports = {
'url': dbUrl
};Deploy To Heroku
If you haven't already, initiate a git repo:
git initTo deploy to heroku, create an app:
heroku create mumsytestAdd heroku as a remote repository:
heroku git:remote -a mumsytest Add project to our git repository:
git add -A
git commit -m "Initial commit" Add the mongolab addon:
heroku addons:create mongolabAdd the APPSECRET configuration variable to heroku:
heroku config:set APPSECRET=myappsecretPush to heroku:
git push heroku masterSetup Admin User
After you start your app locally or on heroku, you will need to visit the /setup path manually to setup your admin user. This process will only work if the app is brand new and there are currently no users in the database.