mumsy-foundation
v0.1.1
Published
A generator to quickly build node web applications.
Downloads
3
Maintainers
Readme
Mumsy
A generator to quickly develop node applications.
Install
Mumsy is installed globally using the following command:
npm install mumsy-foundation -g
Use
Mumsy is ran from the command line inside an empty directory.
Create A Directory
mkdir mumsyproject && cd mumsyproject
Run Mumsy-Foundation
mumsy-foundation
Configure 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 init
To deploy to heroku, create an app:
heroku create mumsytest
Add 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 mongolab
Add the APPSECRET configuration variable to heroku:
heroku config:set APPSECRET=myappsecret
Push to heroku:
git push heroku master
Setup 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.