let connect = require("connect");
let serveStatic = require("serve-static");
let path = require('path');
let app = connect();
app.use(serveStatic(path.join(__dirname, "../static")),{
maxAge: '30d'
});
app.listen(5000); //监听5000端口
nodejs of connect and serve-static achieve static resources visit http
Guess you like
Origin www.cnblogs.com/windyWu/p/12667428.html
Recommended
Ranking