Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 2.5 KB

README.md

File metadata and controls

49 lines (39 loc) · 2.5 KB

Node-mini-server without frameworks

The motivation for choosing an approach without framework was to develop an understanding for JavaScript and Node as they are. I was especially determined to avoid https://www.npmjs.com/package/express.

What does this server offer?

  • Semantic HTML, CSS.
  • Frontend JavaScript.
  • Favicon.
  • Asynchronous/non-blocking.
  • No frameworks.
  • Standalone server. (No Nginx or Apache needed)

What does this server not offer?

What improvements could be made?

What else to consider?

  • Although standalone Node is fully functional, Nginx or Apache in combination with Node bring some advantages.
    1. Nginx is faster than Node and Apache at serving static HTML.
    2. When Node crashes, having Nginx set up as remote proxy allows serving a custom error page.
    3. Nginx and Apache are better tested than Node as they are more frequently exposed to the internet.
  • Bundling frontend JavaScript you may want to use JavaScript modules in the browser (.mjs file ending, <script type="module">, import and export). For example see: https://developers.google.com/web/fundamentals/primers/modules

What about coding style?