app.get() "tailors" that generic server with user code - which will only be invoked by the express server.
app.listen()starts that generic server with the user code that "tailors" its operation ...
The framework often plays the role of the main program in coordinating and sequencing application activity
... which is exactly what app.listen() accomplishes. So express ticks all the boxes for a framework - while the main thread configures the generic server, once running, the generic server calls all the user code that was supplied via configuration.
It really comes down to:
If your code calls it, it's a library.
If it calls your code, it's a framework.
Off course by that definition the http module itself is a "framework" ... node.js Hello world
... because the module "plays the role of the main program" and the module "calls the user code".
This just illustrates that a "framework" doesn't have to be big, complex or "all batteries included".
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
1988 Johnson & Foote:
Looking at the express Hello World:
... which is exactly what
app.listen()
accomplishes. So express ticks all the boxes for a framework - while the main thread configures the generic server, once running, the generic server calls all the user code that was supplied via configuration.It really comes down to:
Off course by that definition the http module itself is a "framework" ...
node.js Hello world
... because the module "plays the role of the main program" and the module "calls the user code".
This just illustrates that a "framework" doesn't have to be big, complex or "all batteries included".