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.
path.join(__dirname,'public','index.html')
If you use
express
, thenapp.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 atest.html
in your public directory, in the routing Just addres.redirect('/test.html')
to the jump logic, public is equivalent to the root path.