Monitor your client-side JavaScript. Detect exceptions and log messages.
CoffeeScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
client
server
.gitignore
Procfile
README.md
client.sh
config.json
example.png
package.json
server.sh

README.md

Mistök

Monitor your client-side JavaScript. Detect exceptions and log messages.

image

Requirements:

Client:

None.

Server:

You can install all dependencies by running:

$ npm install -d
  1. coffee-script.
  2. fs (node stdlib) for reading in files.
  3. url (node stdlib) for parsing request params.
  4. http (node stdlib) for listening to your request-y music.
  5. util (node stdlib) for pump streaming files.
  6. mongodb a MongoDB driver.
  7. eco for embedding CoffeeScript in HTML templates.
  8. less for extending CSS with mixins, variables, functions and the like.
  9. openid for a working OpenID client implementation.
  10. mime for comprehensive MIME type mapping.
  11. ua-parser for determining User-Agent server side.
  12. colors for getting colors in node console.

Use:

Client:

Point to the client script and set it up with your key and server.

<script src="http://mistok.herokuapp.com/js/mistok.js"></script>
<script>
    Mistok.key = '[YOUR_KEY]';
    Mistok.server = 'http://mistok.herokuapp.com';
</script>

To trigger a custom message do the following:

<script>
    Mistok.log('Test message');
</script>

Database:

Install the MongoDB driver appropriate for your OS. Then create a space for the db and start the process:

$ mkdir /data/db
$ ./mongod

Deploying locally, the server expects to find the database at localhost:27017, the default.

Server:

Configure the vars in config.json, by default they are setup for Heroku production and local development environment:

{
    "development": {
        "port": 1116,
        "host": "127.0.0.1:1116",
        "mongodb": {
            "db": "mistok",
            "port": 27017,
            "host": "localhost"
        }
    },
    "production": {
        "host": "mistok.herokuapp.com",
        "mongodb": {
            "db": "app5496588",
            "port": 10098,
            "host": "staff.mongohq.com"
        }
    }
}

Start the server app (making sure CoffeeScript is in your PATH):

$ coffee server/server.coffee

Heroku:

For Heroku deployment, make sure you have an account.

Login to Heroku providing email and password:

$ heroku login

Create the app if does not exist already in your account:

$ heroku create

Set environment variables, like:

$ heroku config:add MONGOHQ_USER=[YOUR_USERNAME] MONGOHQ_PASSWORD=[YOUR_PASSWORD]

Deploy your code:

$ git push heroku master

Check the app is running:

$ heroku ps

If not, see the logs:

$ heroku logs

To login to the console:

$ heroku run bash

If you need to rename the app:

$ git remote rm heroku
$ git remote add heroku git@heroku.com:yourappname.git

Bear in mind that the Procfile specifies a shell script to run, as we need to add the CoffeeScript compiler to the PATH first. We also make use of the process.env.PORT specified by Heroku that is used internally only.

Notes:

  1. Expects you to use Google OpenID auth automatically creating an account for you on the server upon authentication.
  2. Uses custom NIH web server.
  3. When specifying the host, 127.0.0.1 or 0.0.0.0 does not work on Opera while localhost does not work in Chrome.