NodeJS_0011:nodejs重定向到一个链接或本地的页面的方法

1,

    app.get('/NUP', function(req, res, next) {
        var form = fs.readFileSync('public/NodeUP/index.html', { encoding: 'utf8' });
        res.send(form);
        // 重定向到百度
        // res.redirect("https://www.baidu.com");
    });

 

posted @ 2020-07-11 17:23  琥珀君  阅读(1000)  评论(0编辑  收藏  举报