文档
英文API文档
https://expressjs.com/en/api.html
中文API文档
https://expressjs.com/zh-cn/4x/api.html
在 Express 中提供静态文件
提供静态文件不是个简单的事情,但对于express来说就是一句代码的问题:
app.use(express.static('./www'))
要使用多个静态资源目录,可以多次调用 express.static 中间件函数,express根据顺序来查找文件:
app.use(express.static('./www'))
app.use(express.static('/var/www/html'))
END