 
             res.send templates.song
                 artist: song.artist
-                assetsUrl: assetsUrl
+                assetsUrl: getAssetsUrl(req)
                 html: song.toHtml()
                 track: song.track
                 fname: song.fname

        .get (req, res) ->
            songs = loadSongs songDir
            crshUrl = req.crsh.libs.name
            res.end templates.index {songs, assetsUrl, crshUrl}

    # Song view
    app.route '/song/:fname'


module.exports.init = (app) ->

    songDir = app.get 'songDir'

    getAssetsUrl = (req) ->
        if process.env.PRODUCTION?
            "#{req.protocol}://songdown.herokuapp.com/static"
        else
            "#{req.protocol}://localhost:#{app.get 'port'}/static"


    # Index
