node.js - 如何重定向到public下的静态html文件
阿神
阿神 2017-04-17 14:44:53
0
2
556

利用res.res.redirect可以吗?

阿神
阿神

闭关修行中......

reply all(2)
伊谢尔伦

path.join(__dirname,'public','index.html')

阿神

If you use express, then app.use(express.static(path.join(__dirname, 'public'))); set the static file path, so that you can directly access the static html in the public directory. If there is a test.html in your public directory, in the routing Just add res.redirect('/test.html') to the jump logic, public is equivalent to the root path.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template