官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 台山市| 章丘市| 奉节县| 浦江县| 密山市| 汉源县| 广昌县| 高密市| 任丘市| 那曲县| 通山县| 教育| 博白县| 大名县| 明溪县| 通许县| 望谟县| 山东| 彰化市| 武定县| 玉溪市| 辽中县| 合肥市| 江都市| 土默特右旗| 景德镇市| 嫩江县| 扬中市| 星座| 枣庄市| 威海市| 南溪县| 奉新县| 武鸣县| 石柱| 石嘴山市| 台东县| 崇信县| 四会市| 芦溪县| 乌兰察布市|