To use the express library, you create an instance of the express library. You do that by calling express() and it returns an object which popular convention names app, but you can name it anything you want.
const express = require('express'); // load express library
const app = express(); // call express factory to create
// an instance of the express library
You can name the variable app anything you want. The name app is used by popular convention, but you could just as easily have done:
const express = require('express');
const myApp = express();
myApp.get('/', ...);
Note, one of the reasons express requires you to create an instance is that it is possible to have multiple servers in the same piece of code, each that is their own instance of express (app1, app2, app3, etc...). If it didn't require you to create an instance somehow and was only using module-level state for all state, then you could only ever have one server per node.js process which is more limiting than need be.
Folks who listen on both http and https often have two servers in the same app. Or you may serve web pages on one port and serve an API on another port. So the designers of the Express library designed it so that you need an INSTANCE of the express object before you can call .get() on it (thus allowing one to have multiple and completely separate instances) and the express library has offered a factory function express() you can call to create that instance.
express, you create an instance of the express library. You do that by callingexpress()and it returns an object which popular convention namesapp, but you can name it anything you want. Note, it is possible to have multiple servers in the same piece of code, each that is their own instance of express (app1, app2, app3, etc...). Folks who listen on both http and https often do this. So you need an INSTANCE of the express object before you can call.get()on it.