: To check something, we need to put codes about authorization information whenever we meet a router.

: We can define what we need to control before something et to router. And it is MIDDLEWARE.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aa747457-1bd5-40cb-be3f-bae74c438d40/Untitled.png

app.use((req, res, next) => {  // middleware before going to router.
    console.log(req);  // see all request
    next();  // finish middleware and go to next middleware.
});

: When client send requests, server can send more than simple urls like 'body' in 'POST' method.

: express.json() makes it easier to manufacture the data

app.use(express.urlencoded({extended: false}));
app.use(express.json())

: This makes client can see static files.

app.use(express.static('public'));  // to offer static files

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c2850d71-e5d7-41c3-b09e-c21490e76573/Screen_Shot_2021-06-22_at_12.47.58_PM.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e9564dd3-81bb-4faa-88eb-f8571f6f38d9/Screen_Shot_2021-06-22_at_12.47.17_PM.png