Book Image

Three.js Cookbook

By : Jos Dirksen
Book Image

Three.js Cookbook

By: Jos Dirksen

Overview of this book

Table of Contents (15 chapters)
Three.js Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up a local web server using Mongoose


If you would like to test your Three.js applications, then as described in the How to set up a local web server with Python recipe, you can run it in three different ways. If the first two approaches fail, you can always use a simple portable web server using Mongoose. This recipe will focus on the Mongoose approach.

Getting ready

Before you run Mongoose, you first have to download it. You can download Mongoose from https://code.google.com/p/mongoose/downloads/list.

How to do it...

  1. The platform you are using will affect how you run Mongoose. If you're running Windows, you can just copy the downloaded file (an executable) to the folder from where you want to host your files from (for example, the directory where you extracted the sources for this book), and double-click on the executable to start the web server on port 8080.

  2. For Linux or OS X platforms, you will also need to have a copy of the downloaded file in the directory where your files are located, but you have to start Mongoose from the command line.

See also

  • If you can't install a local web server, you can take a look at the Solving cross-origin-domain error messages in Chrome recipe. This recipe provides you with an alternative way of running the more advanced Three.js examples.