app. use() used to Mounts the middleware function or functions at the specified path,the middleware function is executed when the base of the requested path matches path. router. use() is used to middleware function or functions, The defaults mount path to “/”.