2016-02-19 40 views
6

當你開始了精簡版的服務器,例如,你可以指定端口如何指定lite-server的UI端口?

lite-server -- port 8000 

它給你以下結果:

[BS] Access URLs: 
------------------------------------ 
     Local: http://localhost:8000 
    External: http://192.168.0.5:8000 
------------------------------------ 
      UI: http://localhost:3001 
UI External: http://192.168.0.5:3001 

我如何更改端口,用戶界面默認爲3001 (無論是命令行和/或在bs-config.json文件中),喜歡8001?

+1

https://github.com/johnpapa/lite-server#custom-configuration ... –

+0

感謝您的鏈接,但它並沒有解釋如何更改UI端口 - 只有本地端口,我已在示例中設置 - 端口8000標記 – MrLehiste

+0

是的,對不起,我的壞。 –

回答

5

太加,對於像我這樣的慢思考者來說,要在不同的端口上運行lite服務器,請在項目的根目錄下創建文件bs-config.json(或者無論你是誰unning精簡版服務器的),並添加到您的此BS-config.json

{ 
    "port": 8080 
} 

這將在端口運行精簡版服務器8080

alternativelly你可以通過BS-config.json的路徑上運行的精簡版服務器

lite-server -c configs/my-bs-config.json 

來源:https://github.com/johnpapa/lite-server#custom-configuration