Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>1) What is Express.js?</p> </blockquote> <p><a href="https://en.wikipedia.org/wiki/Express.js" rel="noreferrer">Express.js</a> is a <a href="http://en.wikipedia.org/wiki/Node.js" rel="noreferrer">Node.js</a> framework. It's the most popular framework as of now (the most starred on NPM).</p> <p><img src="https://i.stack.imgur.com/eRw5a.png" alt="Enter image description here">. </p> <p>It's built around configuration and granular simplicity of Connect middleware. Some people compare Express.js to <a href="http://en.wikipedia.org/wiki/Sinatra_%28software%29" rel="noreferrer">Ruby Sinatra</a> vs. the bulky and opinionated <a href="http://en.wikipedia.org/wiki/Ruby_on_Rails" rel="noreferrer">Ruby on Rails</a>.</p> <blockquote> <p>2) What is the purpose of it with Node.js?</p> </blockquote> <p>That you don't have to repeat same code over and over again. Node.js is a low-level <a href="http://en.wikipedia.org/wiki/Input/output" rel="noreferrer">I/O</a> mechanism which has an HTTP module. If you just use an HTTP module, a lot of work like parsing the payload, cookies, storing sessions (in memory or in <a href="http://en.wikipedia.org/wiki/Redis_%28data_store%29" rel="noreferrer">Redis</a>), selecting the right route pattern based on <a href="http://en.wikipedia.org/wiki/Regular_expression" rel="noreferrer">regular expressions</a> will <strong>have</strong> to be re-implemented. With Express.js it there for you to use.</p> <blockquote> <p>3) Why do we actually need Express.js? How it is useful for us to use with Node.js?</p> </blockquote> <p>The first answer should answer your question. If no, then try to write a small <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" rel="noreferrer">REST</a> API server in plain Node.js (that is, using only core modules) and then in Express.js. The latter will take you 5-10x less time and lines of code.</p> <blockquote> <p>What is Redis? Does it come with Express.js?</p> </blockquote> <p>Redis is a fast persistent key-value storage. You can optionally use it for storing sessions with Express.js, but you don't need to. By default, Express.js has memory storage for sessions. Redis also can be use for queueing jobs, for example, email jobs.</p> <p>Check out <a href="http://www.webapplog.com/intro-to-express-js-simple-rest-api-app-with-monk-and-mongodb/" rel="noreferrer">my tutorial on REST API server with Express.js</a>.</p> <blockquote> <p>MVC but not by itself</p> </blockquote> <p>Express.js is <strong>not</strong> an model-view-controller framework by itself. You need to bring your own object-relational mapping libraries such as Mongoose for MongoDB, Sequelize (<a href="http://sequelizejs.com" rel="noreferrer">http://sequelizejs.com</a>) for SQL databases, Waterline (<a href="https://github.com/balderdashy/waterline" rel="noreferrer">https://github.com/balderdashy/waterline</a>) for many databases into the stack.</p> <blockquote> <p>Alternatives</p> </blockquote> <p>Other Node.js frameworks to consider (<a href="https://www.quora.com/Node-js/Which-Node-js-framework-is-best-for-building-a-RESTful-API" rel="noreferrer">https://www.quora.com/Node-js/Which-Node-js-framework-is-best-for-building-a-RESTful-API</a>):</p> <p>UPDATE: I put together this resource that aid people in choosing Node.js frameworks: <a href="http://nodeframework.com" rel="noreferrer">http://nodeframework.com</a></p> <p>UPDATE2: We added some GitHub stats to nodeframework.com so now you can compare the level of social proof (GitHub stars) for 30+ frameworks on one page.</p> <p><img src="https://i.stack.imgur.com/1yIPs.png" alt="enter image description here"></p> <p>Full-stack:</p> <ul> <li><p><a href="http://sailsjs.org" rel="noreferrer">http://sailsjs.org</a></p></li> <li><p><a href="http://derbyjs.com/" rel="noreferrer">http://derbyjs.com/</a></p></li> </ul> <p>Just REST API:</p> <ul> <li><a href="http://mcavage.github.io/node-restify/" rel="noreferrer">http://mcavage.github.io/node-restify/</a></li> </ul> <p>Ruby on Rails like:</p> <ul> <li><p><a href="http://railwayjs.com/" rel="noreferrer">http://railwayjs.com/</a></p></li> <li><p><a href="http://geddyjs.org/" rel="noreferrer">http://geddyjs.org/</a></p></li> </ul> <p>Sinatra like:</p> <ul> <li><a href="http://expressjs.com/" rel="noreferrer">http://expressjs.com/</a></li> </ul> <p>Other:</p> <ul> <li><p><a href="http://flatironjs.org/" rel="noreferrer">http://flatironjs.org/</a></p></li> <li><p><a href="https://github.com/isaacs/npm-www" rel="noreferrer">https://github.com/isaacs/npm-www</a></p></li> <li><p><a href="http://frisbyjs.com/" rel="noreferrer">http://frisbyjs.com/</a></p></li> </ul> <p>Middleware:</p> <ul> <li><a href="http://www.senchalabs.org/connect/" rel="noreferrer">http://www.senchalabs.org/connect/</a></li> </ul> <p>Static site generators:</p> <ul> <li><p><a href="http://docpad.org" rel="noreferrer">http://docpad.org</a></p></li> <li><p><a href="https://github.com/jnordberg/wintersmith" rel="noreferrer">https://github.com/jnordberg/wintersmith</a></p></li> <li><p><a href="http://blacksmith.jit.su/" rel="noreferrer">http://blacksmith.jit.su/</a></p></li> <li><p><a href="https://github.com/felixge/node-romulus" rel="noreferrer">https://github.com/felixge/node-romulus</a></p></li> <li><p><a href="https://github.com/caolan/petrify" rel="noreferrer">https://github.com/caolan/petrify</a></p></li> </ul>
    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