Skip to content

Instantly share code, notes, and snippets.

@Zolo101
Last active October 27, 2023 22:51
Show Gist options
  • Select an option

  • Save Zolo101/efdf9958cccf7fe932e58b9240291487 to your computer and use it in GitHub Desktop.

Select an option

Save Zolo101/efdf9958cccf7fe932e58b9240291487 to your computer and use it in GitHub Desktop.
How to get bracketcounter site working locally

Prerequisites

Note

This is only for running the site on your local computer e.g. not online

Steps

  1. Set livemode to true in the config file.
  2. Download bracketcounter-web, and unzip
  3. Open your Terminal to the folder bracketcounter-web
  4. Enter these commands
npm i
npm i -g live-server
  • If your unable to do npm i -g live-server, try npm i live-server
  1. Go to client.ts inside the folder with a text editor of choice and replace this line:
socket = new WebSocket('ws' + (window.location.protocol == "https:" ? "s" : "") + '://' + window.location.hostname + '/socket');

to this:

socket = new WebSocket("ws://127.0.0.1:9764")
  1. Go back to your terminal and enter these commands:
npm run build
live-server
  • If your unable to do live-server, try npx live-server
  1. A browser tab should pop up with a directory screen. If not, go to http://127.0.0.1:8080/ (this is a local website, only your computer can view it!)
  2. Click on dist/. This will open the website!
  3. Start bracketcounter and wait until it finishes collecting comments. After that, you should be able to see the votes on the site!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment