Automates routing as defined in config.
Auto-config menu.
Handlers.
Services.
Middlewares.
Views.
Provides automated assets generation of javascript and stylesheet files for production. It minifies and combines assets as defined in config.
Unit testing using BDD style.
Public methods are methods or objects that can be ran throughout the environment.
-
nodame.appPath()
Return application's absolute path.
var appPath = nodame.appPath();
-
nodame.argv
Return argv object
node index.js --env development
var env = nodame.argv.env;
-
nodame.config()
Return config's value by passing selector. Please see nodame.settings
for direct access to config's object.
var baseUrl = nodame.config('server.url.base');
-
nodame.enforceMobile()
Middleware to enforce mobile view. Not to be used in application.
-
nodame.env()
Return application's environment
var env = nodame.env();
return 'development'
-
nodame.express()
Return new Express' object.
var express = nodame.express();
-
nodame.handler(name string)
Deprecated in 1.0.1. Please see nodame.require()
-
nodame.isDev()
Return whether it's development environment. Production and staging are considered as non-development environment.
if (nodame.isDev()) {
console.log('Hello Dev!');
}
-
nodame.locals()
Middleware to register locals variable. Not to be used in application.
-
nodame.middleware()
Deprecated in 1.0.1. Please see nodame.require()
-
nodame.require(name string)
Native's require wrapper. You are encouraged to use this method instead of native's method as the native method won't load npm modules imported by nodame and nodame modules.
var path = nodame.require('path');
var request = nodame.require('nodame/request');
var foo = nodame.require('module/foo');
-
nodame.router()
Return new express.Router().
var router = nodame.router();
-
nodame.service(name string)
Deprecated in 1.0.1. Please see nodame.require()
-
nodame.set(name string, obj object)
Register object to nodame.settings.__systems
. Not to be used in application.
-
nodame.settings
Return settings value directly. This is a call to nodame.setting
. You can use this to return config value directly by using nodame.settings.config
, for calling config indirectly please see nodame.config()
.
var baseUrl = nodame.settings.config.server.url.base;
-
nodame.sysPath()
Return system's path. Not to be used in application.