Debug custom code |
Debugging custom code requires the MapDashboard WebApp as the debugging environment. So, before debugging, you need to do the following configurations:
const iportalUrl = 'http://localhost:8190/iportal';
<init-param>
<param-name>cors.allowed.origins</param-name>
<!-- Please set the port to the port used by the development environment -->
<param-value>http://localhost:8080</param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>true</param-value>
</init-param>
After configuring the debugging environment, execute the following command in the root directory of the project:
npm start
or
npm run dev
After the command is executed, the browser will automatically open the debugging service address: http://localhost:8080/md/index.html. Click "Components" in the left panel of the interface, find and drag the extended component to the right panel, you can view, debug, and modify the code in real time.
Note: Before executing the debugging command, please make sure that the iPortal service has been started, otherwise you will not be able to access http://localhost:8080/md/index.html during debugging.