How to include Cesium in existing Node.js project?

Hello all!

I have Node.js project and I want to include Cesium into it on front-end. I've read and first downloaded archieve from here. But there a lot of data that is unnecessary for my project. I copied Cesium and CesiumUnminified to my public directory which is available for browser and was able to create a map (tested minified and not minified versions).
My project has next structure . "npm install cesium" installs it to node_modules folder which is not available for browser.
How can I allow access to cesium project without copying to public directory?

The simples way is to do this:
app.use(express.static(path.join(__dirname, '/node_modules/cesium/Build')));

that was taken from here:
Serve static files from multiple directories, but give precedence to “./public” over the others:

app.use(express.static(__dirname + '/public'));
app.use(express.static(__dirname + '/files'));
app.use(express.static(__dirname + '/uploads'));

Yeah, that’s roughly the approach I took in the sample project I just published. I also did some work to handle bundling with Webpack. See the link over in!topic/cesium-dev/Ay7fbqDxyqw for more info.

Mark Erikson

I build a yeoman generator that integrates cesium into an expressjs app:

Thanks for sharing James! If you haven’t already, tweet it at CesiumJS ( and I’m sure you’ll get a retweet for some extra visibility.