vscode+live server - change port number - basic accumulation

Recently, I was writing the front desk. Through jqwriting, I have been complaining about jqthe weak foundation before, and now I am practicing. . . .

When running the page, you can uselive server

1. Install in vscode softwarelive server

insert image description here

2. htmlRight click on the page, there is aopen with live server

insert image description here

3. The computer's default browser will automatically open a page:

insert image description here

4. When the interface is cross-domain, the backend needs to write the page address into the white list, but because the live serverpage link port opened each time is different, so it is necessary to change the live serverstarting port number at this time

5. Change live serverthe startup port number

5.1 Use the shortcut key ctrl+ ,to open the settings panel

insert image description here

5.2 Enter live serverthe keyword and switch to the workspace! ! !

insert image description here

5.3 click在 setting.json 中编辑

insert image description here

5.4 Add in the configuration file——"liveServer.settings.port": xxxx,

insert image description here
The key point is this line: "liveServer.settings.port": 64467,
the port number at this time can be negotiated with the backend to unify the port number.

After saving the configuration, right- htmlclick on the page again to execute open with live server, and you will find that the port number has been changed.

Finish! ! ! A lot of accumulation, a lot of harvest! ! !

Guess you like

Origin blog.csdn.net/yehaocheng520/article/details/128921841
Recommended