![Building Enterprise JavaScript Applications](https://wfqqreader-1252317822.image.myqcloud.com/cover/349/36699349/b_36699349.jpg)
上QQ阅读APP看书,第一时间看更新
Modularizing our code
If you take a look inside the src/index.js file, you'll see that there are three top-level middleware functions—checkEmptyPayload, checkContentTypeIsSet, and checkContentTypeIsJson—as well as an anonymous error handler function. These are prime candidates that we can extract into their own modules. So, let's get started!