 
 _ = require 'underscore'
 express = require 'express'
+na = require 'nodealytics'
 assets = require 'connect-assets'
 ejs = require 'ejs'
 passport = require 'passport'

  User.findByShortName req.user.effective.shortName, (err, user) ->
    resp.send 200, user.sshKeys

app.all '*', ensureAuthenticated

app.get '/logout', logout

# API!
app.get '/api/tools/?', listTools
app.post '/api/tools/?', postTool

app.put '/api/user/?', updateUser


  console.warn "MONGOOSE CONNECTION ERROR #{err}"

Exceptional.API_KEY = process.env.EXCEPTIONAL_KEY

if /production/.test process.env.NODE_ENV
  na.initialize 'UA-21451224-7', 'scraperwiki.com'
else
  na =
    trackPage: -> return true
    trackEvent: -> return true

# TODO: move into npm module
nodetimeLog = (req, res, next) ->
