J
J
Jiakki-js2015-05-08 19:58:02
JavaScript
Jiakki-js, 2015-05-08 19:58:02

Is it ok to make one global variable in Node.js?

express = require 'express'
app = express()

Sometimes you need to access an app from outside the main file
Is it okay to do this?
global.app = app
What could be the consequences?
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question