- Run
npm install
from the root (../../
) - Start a redis server on port
6379
:docker run --name some-redis -p 6379:6379 redis
- Run
npm start
- Visit http://localhost:8000
- Each Vote is isolated, voting yes/no will auto update the total votes using via graphql subscriptions. You can also open the same url in a new tab, add more votes and the changes will be reflected across each app instance.
Make sure that there is a Redis
server running on 127.0.0.1:6379
. Or update the configuration in /src/server/index.js
file.
In the examples/subscription
folder, run the following command
node src/server/index.js
In the examples/subscription
folder, run the following command
npm run build
Open http://localhost:8000
The data is persisted and it is possible to run the example in a multi-server set up by starting up the server with the following command
APP_PORT=PORT node src/server/index.js
where PORT
is the port number you want the application to listen on.