Quantcast
Channel: What does the second bracket in "var app = require('express')()" do? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Hector Correa for What does the second bracket in "var app =...

Thefourtheye answered your question, but here is a simplified example of what is happening. Start by creating a file x.js with one function as shown below.// x.jsexports.x = function() { return...

View Article



Answer by thefourtheye for What does the second bracket in "var app =...

When you sayrequire('express')it is this file, which gets executed and it exports createApplication function. You can check that, like thisconsole.log(require('express'));// { [Function:...

View Article

What does the second bracket in "var app = require('express')()" do?

I'm quite new at the express framework.I looked up at the Socket.io website for a quick start and I saw this statement at "Using with the Express 3 web framework". And in this line of the code...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>