NodeJS / Express: what is “app.use”?

后端 未结 23 1436
别跟我提以往
别跟我提以往 2020-11-29 14:48

In the docs for the NodeJS express module, the example code has app.use(...).

What is the use function and where is it defined?

23条回答
  •  感情败类
    2020-11-29 15:26

    app.use
    is created by express(nodejs middleware framework )
    app.use is use to execute any specific query at intilization process
    server.js(node)
    var app = require('express');
    app.use(bodyparser.json())
    so the basically app.use function called every time when server up

提交回复
热议问题