         .get (req, res) ->
             songs = loadSongs songDir
             crshUrl = req.crsh.libs.name
-            res.end templates.index {songs, assetsUrl, crshUrl}
+            res.end templates.index {songs, assetsUrl: getAssetsUrl(req), crshUrl}
 
     # Song view
     app.route '/song/:fname'


module.exports.init = (app) ->

    assetsUrl = if process.env.PRODUCTION?
        console.log 'Using the production assetsUrl'
        'https://songdown.herokuapp.com/static'
    else
        console.log 'Using the development assetsUrl'
        "https://localhost:#{app.get 'port'}/static"

    songDir = app.get 'songDir'


    # Index


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