- Hands-On Full-Stack Web Development with GraphQL and React
- Sebastian Grebe
- 79字
- 2021-07-02 13:20:45
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.