Book Image

Go Programming Blueprints

By : Mat Ryer
Book Image

Go Programming Blueprints

By: Mat Ryer

Overview of this book

Table of Contents (17 chapters)
Go Programming Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Running the solution


We have built many components over the last two chapters, and it is now time to see them all working together. This section contains everything you need 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 four subfolders: api, counter, twittervotes, and web.

Assuming nothing is running, take the following steps (each step in its own terminal window):

  1. In the top-level folder, start the nsqlookupd daemon:

    nsqlookupd
    
  2. In the same directory, start the nsqd daemon:

    nsqd --lookupd-tcp-address=localhost:4160
    
  3. Start the MongoDB daemon:

    mongod
    
  4. Navigate to the counter folder and build and run it:

    cd counter
    go build –o counter
    ./counter
    
  5. Navigate to the twittervotes folder and build and run it. Be sure that you have the appropriate environment variables set, otherwise you will see errors when you run the program:

    cd ../twittervotes
    go build...