Build the server
To run the Cesium program, we need a local server to host our files, and then we're going to use node. js to complete our tutorial (I'm using IIS myself). If you already have one, then you use it, no matter, just remember that the host is the one we created above the root on the line.
Building node. js is simple, just 3 steps.
1. Download and install node. js, all on the default configuration.
2. Open the command line in the root directory and install the Connect package via NPM install connect. This will create a ' node_modules ' directory in our root directory.
3. Install the Runtime Library:
NPM Install Express
NPM Install compression
NPM Install request
NPM Install Yargs
3. Finally, open the server in the root directory by executing node server.js. (You can modify the port number by modifying the Server.js file, default 8080)
Hello again, world.
Now our server is running, open the browser and type http://localhost:8080/HelloWorld.html enter
Configuration from (modified part):
http://www.fwqtg.NET/%E7%BF%BB%E8%AF%91-cesium%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B%E4%B8%80-%E7%8E%AF%E5%A2%83 %e9%85%8d%e7%bd%ae-hello-world.html
Cesium Configuring the node. js method