简体   繁体   中英

When should I use express.js over a standalone node.js

Node.js is a javascript environment

Express is a framework

What is a software framework? for Node.js?

Why and when is it useful to use Express framework over Node.js standalone?

What I mean is that, is this framework just a set of ready functions and modules that makes it easier to write codes from scratch?

I'm asking this because I found lots of tutorials and guides on NodeJS with Express, but just a few on standalone NodeJs.

As you suspect, Express.js just makes it easier to write a Node.js webapp. You could build anything you could with Express.js without it.

Many factors go into whether to use a given framework or not, such as available support, documentation, future development, does it fit needs of project, etc. Express.js is the most popular Node.js web application framework, but that doesn't mean it should automatically be your choice. Here's a link to an article which you may find interesting, and contains alternatives to Express.js which may be worth exploring - https://scotch.io/bar-talk/the-future-of-expressjs-and-alternatives

You can also check out this tutorial on writing a Node.js application without a framework - http://www.nodebeginner.org/

The reason it is famous because Easy learning curve .There are lot of inbuilt, third-party middleware compatible with it. It overall provides complete structure in clean syntax. And yes you are right ,it is just a set of ready functions and modules that can be used easier than writing code from 0. It saves time. There lot of resources on nodejs with express.

But The same functionality can be done without expressjs which requires research.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM