


The Express framework will automatically set the appropriate content type for us, instead of manually setting the ContentType.īut lightweight frameworks such as Express still haven’t solved some problems: When processing the HTTP response, you can also directly return the JSON file through res.json(), and use res.sendFile() to return the binary file.

With the routing function provided by Express, we no longer need to write all kinds of inefficient if statements as before.
