node.jsexpress

Express js Where do the settings go?


In the express docs, there is a section called settings: http://expressjs.com/api.html#app-settings

But I can't figure out where exactly the should go (to some function? as a dictionary in the use middleware? or somewhere else?)

P.S. How would I go about figure theses things out - do I need to look at source?


Solution

  • You have to use app.set:

    app.set('name of setting', 'value');