上QQ阅读APP看书,第一时间看更新
Installing important middleware
For our application, we have already used one built-in Express.js middleware: express.static. Throughout this book, we continue to install further middleware:
npm install --save compression cors helmet
Now, execute the import statement on the new packages inside the server index.js file so that all dependencies are available within the file:
import helmet from 'helmet';
import cors from 'cors';
import compress from 'compression';
Let's see what these packages do and how we can use them.