Class: config


Configuration object, that is passed to Hunt constructor


new config()

Name Type Description
hostUrl string

url to host of current application, used in oAuth authentication strategies and for building redirects. Populated from environment variable of HOST_URL. For example -

env string

application environment, if not set, populated from enviromental value of NODE_ENV. Default is development, the values of staging and production can be used

port number

port for webserver process(es) to bind to. Note: on *nix machines ports with number bellow 1000 are only bindable by applicaiton ran as root user.

address string | null

what address to bind to. Default is '' - all IPv4 addresses. The address is populated from environment address of HUNTJS_ADDR. HuntJS supports both IPv4 and IPv6 addresses as described here.

enableMongoose boolean

enable mongo support via mongoose orm, default is true - enabled

mongoUrl string

connection string for mongoose ORM, default is 'mongodb://localhost/hunt_dev'. It can be automatically populated from enviromental values of MONGO_URL, MONGOSOUP_URL,MONGOHQ_URL,MONGOLAB_URL. Connection string has this syntax

enableMongooseUsers boolean

enable mongodb based user object, build by pattern of Active Record. Default is true - enabled

redisUrl string

connection string for redis, default is 'redis://localhost:6379', can be populated from enviromental variables of 'REDISTOGO_URL', 'OPENREDIS_URL', 'REDISCLOUD_URL', 'REDISGREEN_URL', 'REDIS_URL'

sequelizeUrl string

URI for relational database connection. Is used in Hunt-sequilize plugin

public string

directory for assets - css, images, client side javascripts, that are served by connect static middleware for example, 'public': __dirname+'/public'

views string

directory for templates, used by template engine for rendering static HTML pages on server side. See this tutorial for details

emailConfig string

configuration string for email delivery system , used for notify users. When left blank, the direct transport is used - it is quite slow, and the emails are usually marked as spam. Also you can set up SMTP options directly like mentioned here Examples: 'nodemailer://', 'nodemailer://',

usersApi Boolean

enable REST-api for editing user profiles

dialog Boolean

enable dialog REST-api for private messages

huntKey Boolean

enable authorization by huntKey as GET query, or POST/PUT/DELETE body parameter. Default is false - disabled

huntKeyHeader Boolean

enable authorization by huntKey as custom header, default is false - disabled

disableCsrf Boolean

disable csrf protection, default is false - CSRF protection is enabled. See for details. Also this works from the box with AngularJS $resourse and $http

adminEmail String

email address of server administrator. If present, every error will be reported to this email with plenty of additional information and error stack.

maxWorkers number

limit the number of webserver/background processes cluster spawns. Default - 1 per CPU core.

passport passport

passport.js configuration object, used for setting the methods users authorize,

bodyParserLimit String

limit the size of request body. See body-parser documentation for detauls. Default is '100kb'

uploadFiles boolean

allow upload of files by HTTP-POST,, default is false, disabled, and for a good cause!topic/nodejs/6KOlfk5cpcM

io object

configuration options for Default is {'enabled':false}, make {'enabled':true} to enable. We can use this parameters for setup - If we passtrue`, the sane default values will be set.

favicon string

path to favicon

secret string

string to preseed session hashes and do other security related things

telnetServer object

configuration options for RAI telnet server