AnalyticalGraphicsInc/cesium — pull request #1866 by shunter (2014-06-26 21:45:17+00:00)
Title: Replace development server with a new Node.js server.

The new server supports almost all the features of the Java-based server, which used Jetty.

Dropped features:
* The hostname restrictions. The new version allows proxying to any host, and as such should not be used as a public proxy.
* The `/terrain` proxy that re-encodes terrain heightmaps from ArcGIS Image Server from TIFF to PNG.

Added features:
* ETags should work now. This should fix caching problems when switching between two different clones of a Cesium repo and running the server on the same port in each one. (the previous server only supported If-Modified-Since checks, which is reliable when switching between branches)
* A new syntax for specifying proxy urls, suggested by @kring. Instead of encoding the URL as a query parameter, we can simply dump the entire URL to be proxied into the path after `/proxy/`, e.g. `http://localhost:8080/proxy/http://cesiumjs.org/Cesium/README.md`. This syntax is easier to read since there's no escaping (I was surprised to discover that `:` is permitted unescaped in the path portion of the URL).
* The old syntax is still supported. Once I make this work on cesiumjs.org as well, we can change the behavior of `DefaultProxy`.
* `node server.js --help` now shows usage instructions for the various parameters.

Changed behavior:
* Previously, redirects that use the Location header were translated and sent to the browser. Now, the proxy itself follows redirects. For example, supposing server A redirects to server B, requesting A through the proxy would previously return a proxied URL to B, but now silently returns B.
* The build script now automatically runs `npm install` before running commands that require NPM packages. If everything is already installed, this is a silent no-op.
* The ant targets to runServer, etc. still work. They log information about running the server directly via node if the user prefers.
* This new `server.js` and `package.json` are included in the release zips. We'll need to update the getting started blog post to say to run `npm install`.

Breaking change:
* Node.js is now required to be installed on the system, and available in the path, in order to run any build target that depends on Node, which is basically all steps except `build` and `clean`. The included executables (which are over two years old) are deleted.
* Eventually the rest of the build will move to Node, and we'll drop the requirement for Java.