A downloadable server

This is a server that exposes @barelyconcealed's 1000 Button Project hardware as a web API.

Easily make games for the 100 Button Game Jam, even if you don't have access to the hardware for testing.

How on earth can my game talk to custom hardware?

Some languages and game frameworks make it hard to talk directly to custom hardware. Just about every programming environment on the planet can make web requests. This server bridges the gap. Your game talks to the server, and the server talks to the hardware.

How do I use it?

Grab the latest release. You probably want darwin-x64 for macOS, linux-x64 for Linux, or win32-x64 for Windows.

Unzip it, rename config.json.example to config.json, and run buttons-are-cool-gateway --testmode.

The server runs on localhost, port 3000, by default. Your game can ask the server for the current state of the entire board by making a regular web request (HTTP GET) to http://localhost:3000/buttons. Or, your game can subscribe to real-time button press and release events by connecting to the WebSocket hosted at http://localhost:3000/.

Check out the documentation to see how the server sends button data.

How can I tell if it's working?

When the server's running, you can visit http://localhost:3000 in your browser to see a testing page. If you have a button board hooked up, restart the server without --testmode, and push buttons to light up the button numbers on that test page.

Test mode

If you don't have a button board, start the server with --testmode:

buttons-are-cool-gateway --testmode

In test mode, the server ignores the serial ports and the test page can act as a controller. Open the test page in two separate browser windows and click some of the button numbers. Clicking in the first window lights up buttons in the second window. The server makes it look like the numbers you click are button presses coming from an actual button board.

Downloads (prebuilt for Linux/Mac/Windows)

Releases on GitHub

Documentation and source code

README

Questions?

Hit me up on Twitter at @mildmojo, or start a thread in the 100 Button Jam Community.

Leave a comment

Log in with itch.io to leave a comment.