How to manipulate static file resources in express?

app.use (express.static (path.join (_ _ dirname, "public"); ), how can I get the address of the static resource file root directory after setting the static address? There is no need to consider the specific file address, for example, in the public network, the static resource address is https://img.codeshelper.com/upload/img/2021/03/20/hxxg1bgamok11281.jpg, how to get the http://demo.com/static/?

Mar.20,2021

as long as you know the address where the avatar is stored, you can return it. You can store the avatar address in the database, and then return this address. As long as the front end knows the image address, it can render

.
Menu