Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use a <code>package.json</code> for my packages and a <code>config.js</code> for my configuration, which looks like:</p> <pre><code>var config = {}; config.twitter = {}; config.redis = {}; config.web = {}; config.default_stuff = ['red','green','blue','apple','yellow','orange','politics']; config.twitter.user_name = process.env.TWITTER_USER || 'username'; config.twitter.password= process.env.TWITTER_PASSWORD || 'password'; config.redis.uri = process.env.DUOSTACK_DB_REDIS; config.redis.host = 'hostname'; config.redis.port = 6379; config.web.port = process.env.WEB_PORT || 9980; module.exports = config; </code></pre> <p>I load the config from my project:</p> <pre><code>var config = require('./config'); </code></pre> <p>and then I can access my things from <code>config.db_host</code>, <code>config.db_port</code>, etc... This lets me either use hardcoded parameters, or parameters stored in environmental variables if I don't want to store passwords in source control.</p> <p>I also generate a <code>package.json</code> and insert a dependencies section:</p> <pre><code>"dependencies": { "cradle": "0.5.5", "jade": "0.10.4", "redis": "0.5.11", "socket.io": "0.6.16", "twitter-node": "0.0.2", "express": "2.2.0" } </code></pre> <p>When I clone the project to my local machine, I run <code>npm install</code> to install the packages. More info on that <a href="http://howtonode.org/introduction-to-npm" rel="noreferrer">here</a>.</p> <p>The project is stored in GitHub, with remotes added for my production server.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload