Monitor your client-side JavaScript. Detect exceptions and log messages.
None.
You can install all dependencies by running:
$ npm install -d
- coffee-script.
fs
(node stdlib) for reading in files.url
(node stdlib) for parsing request params.http
(node stdlib) for listening to your request-y music.util
(node stdlib) for pump streaming files.- mongodb a MongoDB driver.
- eco for embedding CoffeeScript in HTML templates.
- less for extending CSS with mixins, variables, functions and the like.
- openid for a working OpenID client implementation.
- mime for comprehensive MIME type mapping.
- ua-parser for determining User-Agent server side.
- colors for getting colors in node console.
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>
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.
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
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 [email protected]: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.
- Expects you to use Google OpenID auth automatically creating an account for you on the server upon authentication.
- Uses custom NIH web server.
- When specifying the host,
127.0.0.1
or0.0.0.0
does not work on Opera whilelocalhost
does not work in Chrome.