Skip to content

About

Rookout official tutorial for using Node.js

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Rookout official tutorial for using Node.JS

CircleCI License Docs GitHub version

This is the official rookout Node.JS tutorial

Prerequisites

  1. Docker - https://www.docker.com/get-docker
  2. Node.JS v8.X.X + NPM

Installation

  1. Clone this repo
git clone https://github.com/Rookout/tutorial-nodejs.git
cd tutorial-nodejs
  1. Set your agent token in an ENV variable
export ROOKOUT_TOKEN=YOUR_TOKEN_IN_HERE
  1. Build the app then run the agent & app
  • Option 1 - Running the app and agent with docker compose
docker-compose up
  • Options 2 - Without Docker (Linux only):
make -j run-prod
  • Options 3 - Running the agent ONLY in docker and the app locally (All platforms)
docker-compose up rookout-agent
# To run in the background: docker-compose up -d rookout-agent
make start-web

Usage

  • After running the app & agent go to https://app.rookout.com/ and Log In

  • Add the source code according to the instructions using the left pane Source View

    More details

    Adding source code

    1. Click on Add source
    2. Choose source control
      • Github
        • Click on Connect
        • Authorize O-Auth
        • Fill Repository Owner
        • Click Repository and choose from the dropdown menu
        • Click Next
        • Choose the desired branch
        • Click View Repository
      • Local FileSystem - Server
        • Click on Setup Server
        • Choose a supported HTTP Server (Node.js)
        • Leave the default port 8000 or choose your own
        • Run your local server e.g. simple-https -p 8000 in the right directory
        • Click on Connect to Server

  • Open the file src/handlers/homePage.js

  • Add a default (Dump Frame) rule to line 5 by clicking next the the line number in the file viewer

  • Looking at the right-hand pane Rules, you will see the rule and the line number where you added it - it should be GREEN.

    • If this is not the case, click here to see how to fix that
  • Go the the app page http://localhost:4000/ in order to trigger the rule

  • Check the bottom pane Messages and you'll see the dumpframe you just added, as it was triggered by the handler of the web page when you accessed it

Go through the bug list and follow instructions to see some basic use cases.

Rules Common Issues

  • Rule status is RED -- Hash mismatch. It means the file used in the server is not the same file used from github/local server in app.rookout.com
  • Rule status is GRAY -- No rook connected to the agent. Make sure you have inserted the token in the right place and that connection is made properly.

Want to learn more ?

License

APACHE 2

About

Rookout official tutorial for using Node.js

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages