The HOOPS Server is a Node.js application that allows for quick and easy experimenting with HOOPS Communicator. It includes a default configuration that requires no modifications in order to start viewing 3D models in a browser, but can easily be customized to work in the context of your environment by following a few simple steps.
Editing the Quick Start Configuration File
Begin by opening the default HOOPS Server configuration file located in your package at: quick_start/server_config.js. Each option specified in the configuration has a description of the Server functionality it controls. For the majority of the settings, the default values will be appropriate for most use cases, however you will most likely need to modify the following values to get the server to work outside of the context of the HOOPS Communicator package:
- fileServerStaticDirs: Set this option to an array of strings which contain paths to directories that contain your static HTML files.
- streamCacheExeFile: Set this path to the ts3d_sc_server executable
- modelDirs: Set this value to an array containing all the paths which contain your SC models
- licenseFile / license: Choose one of these variables to set with your HOOPS Communicator License
For more information on the location of these files in your HOOPS Communicator package, consult our Package Description page.
Starting the Server
The quick_start section of the HOOPS Communicator package contains a convenience script for starting the HOOPS Server. On Windows, simply double click "start_server.bat" from the file explorer view. On Linux or MacOS, run start_server.sh from a terminal. The server should start up quickly, and will display a message indicating that the server is listening on the configured ports and ready to handle viewer requests.
Viewing Models and Monitoring the System
Once the server has started you will be able to view your static html pages in the browser. The default port for the HTTP server is 11180. You can bring up and index page which contains converted sample models by either navigating to http://localhost:11180/ or opening the index file from your file system. As viewing sessions are started, you can get a detailed view of the current state of the HOOPS server by making a GET request to the spawning service’s status endpoint. With the default configuration, the spawning service runs on port 11182.
Stopping the Server
When run from a terminal, the server will remain active until the enter key is pressed.
Alternatively, the server can also be stopped by issuing a POST request to the api/shutdown endpoint. With curl, this can be done as curl -X POST http://localhost:11182/api/shutdown.
When the server shuts down, any spawned processes that are active will also be terminated.