This is a basic, example implementation of Express and 2bttns. Play a food preference sorting game and view the results.
To run this app, you'll need to run both the 2bttns console and the node server used to interact with the console. You can use the basic HTML file to interface.
- Run 2bttns
cd 2bttns
npm i
npm run dev
- Run Node Server for interacting with 2bttns on client side
Make sure you have these .env
variables where your node server is if not successfully pulled from github.
TWOBTTNS_BASE_URL="http://localhost:3001"
TWOBTTNS_APP_ID="example-app"
TWOBTTNS_APP_SECRET="example-secret-value"
cd web-app
npm i
node server.js
-
Open the index.html page in your browser
-
Play a game (currently set to food preference ranking)
-
Go back to index.html and click Get Results to view your scores. Play more rounds to see how your rankings change.
- Get other example data using the @2bttns/object CLI.
# anywhere
npx @2bttns/objects
-
Open 2bttns Console at http://localhost:3001/
-
Log in with admin credentials (u: admin, pwd: admin)
-
Upload & Tag your objects (Learn how here)
-
Create a game (Learn how here)