nimblephysics
nimblephysics copied to clipboard
Bundle an HTTP server into C++
Currently, in order to run the web GUI from C++, you need to boot the websocket server using code that looks like this:
server::GUIWebsocketServer server;
server.renderWorld(world);
server.renderBasis();
server.serve(8070);
while (server.isServing())
{
}
If you then attempt to directly connect to localhost:8070 in your web browser, you'll get an error, because that's only a websocket server. You also need to go into our javascript folder and call npm run dev to host an HTTP server, then visit localhost:9000 in your browser. It'd be nice to bundle the server on the C++ side, so it hosts the HTTP server too.