簡體   English   中英

動態站點需要什么 Browsersync 代理設置,我正在嘗試運行我的 app.js 文件但頁面超時

[英]What are the Browsersync proxy settings needed for a dynamic site, i'm trying to run my app.js file but the page times out

    var bSync = done => {
        browserSync.init({

            proxy: {
                target: "localhost:" + 3000 + "/"
            },
            files: ['app.js'],

我之前嘗試過的設置

            // injectChanges: true,
            // proxy: '127.0.0.1:3000/',
            // host: 'localhost',
            // port: 3000
        });
        done();
    };

我怎樣才能讓它發揮作用 - 有什么想法嗎? 我基本上想設置一個 gulp 文件,它允許我啟動我的快速服務器,然后是路由和 ejs 文件

我終於讓它像這樣工作了。 端口和代理是相同的,但是通過將端口切換到 3003 可以正常工作。 隧道意味着我可以在生產過程中連接其他設備,例如我的手機,以查看布局等,這非常有用。

const bSync = () => {
    browserSync.init({
        proxy: 'localhost:3000',
        port: 3003,
        online: true,
        tunnel: true
    });
};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM