Running the solution
We built many components over the previous two chapters, and it is now time to see them all working together. This section contains everything you need in order to get all the items running, assuming you have the environment set up properly, as described at the beginning of the previous chapter. This section assumes you have a single folder that contains the four subfolders: api, counter, twittervotes, and web.
Assuming nothing is running, take the following steps (each step in its own terminal window):
In the top-level folder, start the
nsqlookupddaemon:nsqlookupdIn the same directory, start the
nsqddaemon:nsqd --lookupd-tcp-address=localhost:4160Start the MongoDB daemon:
mongodNavigate to the
counterfolder and build and run it:cd counter go build -o counter ./counter
Navigate to the
twittervotesfolder and build and run it. Ensure that you have the appropriate environment variables set; otherwise, you will see errors when you run the program:cd ../twittervotes...