2016-02-19 93 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