{"action":"created","comment":{"url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/comments/26509664","id":26509664,"diff_hunk":"@@ -1,44 +1,32 @@\n-'use strict';\n+var path = require('path');\n \n var express = require('express');\n var favicon = require('serve-favicon');\n-var path = require('path');\n+\n \n module.exports = function(app, baseDir, config) {\n-    var env = app.get('env');\n     var servedDirectory = 'app';\n \n-    if ('development' === env) {\n-        // Disable caching of scripts for easier testing\n-        app.use(function noCache(req, res, next) {\n-            if (req.url.indexOf('/js/') === 0) {\n-                res.header('Cache-Control', 'no-cache, no-store, must-revalidate');\n-                res.header('Pragma', 'no-cache');\n-                res.header('Expires', 0);\n-            }\n-            next();\n-        });\n-\n-        app.use(config.baseUrl, express.static(path.join(__dirname, '.tmp')));\n-    }\n+    if ('production' === app.get('env')) {\n+        servedDirectory = 'dist';\n \n-    if ('production' === env) {\n         // prerender.io\n         app.use(require('prerender-node').set('prerenderToken', process.env.PRERENDER_TOKEN).set('protocol', 'https'));\n-\n-        servedDirectory = 'dist';\n-        app.use(favicon(path.join(__dirname, 'dist', 'favicon.ico')));\n+    } else {\n+        app.use(config.baseUrl + '/styles', express.static(path.join(__dirname, '.tmp', 'styles')));  // ugly hack to serve compiled SCSS; you will need to `grunt build` every time you change a style\n     }\n \n-    app.use(config.baseUrl, express.static(path.join(__dirname, servedDirectory)));\n+    servedDirectory = path.join(__dirname, servedDirectory);\n+\n+\n+    app.use(config.baseUrl, express.static(servedDirectory));\n     app.use(config.baseUrl + '/scripts/template.js', express.static(path.join(baseDir, config.scenarioTemplate)));\n     app.use(config.baseUrl + '/scripts/constants.js', express.static(path.join(baseDir, config.constants)));\n-\n-    app.get(config.baseUrl + '/scripts/server-config.js', function (req, res) {\n+    app.get(config.baseUrl + '/scripts/server-config.js', function(req, res) {","path":"index.js","position":48,"original_position":48,"commit_id":"6a0bd72452d2c61864c597a6c183ee208dd77671","original_commit_id":"6a0bd72452d2c61864c597a6c183ee208dd77671","user":{"login":"jdesboeufs","id":1231232,"avatar_url":"https://avatars.githubusercontent.com/u/1231232?v=3","gravatar_id":"","url":"https://api.github.com/users/jdesboeufs","html_url":"https://github.com/jdesboeufs","followers_url":"https://api.github.com/users/jdesboeufs/followers","following_url":"https://api.github.com/users/jdesboeufs/following{/other_user}","gists_url":"https://api.github.com/users/jdesboeufs/gists{/gist_id}","starred_url":"https://api.github.com/users/jdesboeufs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdesboeufs/subscriptions","organizations_url":"https://api.github.com/users/jdesboeufs/orgs","repos_url":"https://api.github.com/users/jdesboeufs/repos","events_url":"https://api.github.com/users/jdesboeufs/events{/privacy}","received_events_url":"https://api.github.com/users/jdesboeufs/received_events","type":"User","site_admin":false},"body":"I use [Douglas Crockford](http://javascript.crockford.com/code.html#variable%20declarations) conventions for JavaScript since some months.\r\n\r\n> If a function literal is anonymous, there should be one space between the word function and the ( (left parenthesis). If > the space is omited, then it can appear that the function's name is function, which is an incorrect reading.\r\n\r\nBut we are not consistent in many projects...","created_at":"2015-03-16T17:49:53Z","updated_at":"2015-03-16T17:49:53Z","html_url":"https://github.com/sgmap/ludwig-ui/pull/12#discussion_r26509664","pull_request_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/comments/26509664"},"html":{"href":"https://github.com/sgmap/ludwig-ui/pull/12#discussion_r26509664"},"pull_request":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12","id":31264617,"html_url":"https://github.com/sgmap/ludwig-ui/pull/12","diff_url":"https://github.com/sgmap/ludwig-ui/pull/12.diff","patch_url":"https://github.com/sgmap/ludwig-ui/pull/12.patch","issue_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/12","number":12,"state":"open","locked":false,"title":"Clean index.js","user":{"login":"MattiSG","id":222463,"avatar_url":"https://avatars.githubusercontent.com/u/222463?v=3","gravatar_id":"","url":"https://api.github.com/users/MattiSG","html_url":"https://github.com/MattiSG","followers_url":"https://api.github.com/users/MattiSG/followers","following_url":"https://api.github.com/users/MattiSG/following{/other_user}","gists_url":"https://api.github.com/users/MattiSG/gists{/gist_id}","starred_url":"https://api.github.com/users/MattiSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattiSG/subscriptions","organizations_url":"https://api.github.com/users/MattiSG/orgs","repos_url":"https://api.github.com/users/MattiSG/repos","events_url":"https://api.github.com/users/MattiSG/events{/privacy}","received_events_url":"https://api.github.com/users/MattiSG/received_events","type":"User","site_admin":false},"body":"Paying back some debt as a side-effect of exploring #11 and #10.","created_at":"2015-03-16T17:20:46Z","updated_at":"2015-03-16T17:49:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07f14c45f890212003b0f4f8ecbbc55276192235","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12/commits","review_comments_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12/comments","review_comment_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/12/comments","statuses_url":"https://api.github.com/repos/sgmap/ludwig-ui/statuses/6a0bd72452d2c61864c597a6c183ee208dd77671","head":{"label":"sgmap:cleanup","ref":"cleanup","sha":"6a0bd72452d2c61864c597a6c183ee208dd77671","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":29688210,"name":"ludwig-ui","full_name":"sgmap/ludwig-ui","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/ludwig-ui","description":"Outil de tests de loi","fork":false,"url":"https://api.github.com/repos/sgmap/ludwig-ui","forks_url":"https://api.github.com/repos/sgmap/ludwig-ui/forks","keys_url":"https://api.github.com/repos/sgmap/ludwig-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/ludwig-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/ludwig-ui/teams","hooks_url":"https://api.github.com/repos/sgmap/ludwig-ui/hooks","issue_events_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/ludwig-ui/events","assignees_url":"https://api.github.com/repos/sgmap/ludwig-ui/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/ludwig-ui/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/ludwig-ui/tags","blobs_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/ludwig-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/ludwig-ui/languages","stargazers_url":"https://api.github.com/repos/sgmap/ludwig-ui/stargazers","contributors_url":"https://api.github.com/repos/sgmap/ludwig-ui/contributors","subscribers_url":"https://api.github.com/repos/sgmap/ludwig-ui/subscribers","subscription_url":"https://api.github.com/repos/sgmap/ludwig-ui/subscription","commits_url":"https://api.github.com/repos/sgmap/ludwig-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/ludwig-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/ludwig-ui/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/ludwig-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/ludwig-ui/merges","archive_url":"https://api.github.com/repos/sgmap/ludwig-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/ludwig-ui/downloads","issues_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/ludwig-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/ludwig-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/ludwig-ui/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/ludwig-ui/releases{/id}","created_at":"2015-01-22T16:31:07Z","updated_at":"2015-03-13T16:39:16Z","pushed_at":"2015-03-16T17:19:06Z","git_url":"git://github.com/sgmap/ludwig-ui.git","ssh_url":"git@github.com:sgmap/ludwig-ui.git","clone_url":"https://github.com/sgmap/ludwig-ui.git","svn_url":"https://github.com/sgmap/ludwig-ui","homepage":null,"size":504,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"sgmap:master","ref":"master","sha":"7ccb047d24315391f6ce310580e9c5f6fba2033d","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":29688210,"name":"ludwig-ui","full_name":"sgmap/ludwig-ui","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/ludwig-ui","description":"Outil de tests de loi","fork":false,"url":"https://api.github.com/repos/sgmap/ludwig-ui","forks_url":"https://api.github.com/repos/sgmap/ludwig-ui/forks","keys_url":"https://api.github.com/repos/sgmap/ludwig-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/ludwig-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/ludwig-ui/teams","hooks_url":"https://api.github.com/repos/sgmap/ludwig-ui/hooks","issue_events_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/ludwig-ui/events","assignees_url":"https://api.github.com/repos/sgmap/ludwig-ui/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/ludwig-ui/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/ludwig-ui/tags","blobs_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/ludwig-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/ludwig-ui/languages","stargazers_url":"https://api.github.com/repos/sgmap/ludwig-ui/stargazers","contributors_url":"https://api.github.com/repos/sgmap/ludwig-ui/contributors","subscribers_url":"https://api.github.com/repos/sgmap/ludwig-ui/subscribers","subscription_url":"https://api.github.com/repos/sgmap/ludwig-ui/subscription","commits_url":"https://api.github.com/repos/sgmap/ludwig-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/ludwig-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/ludwig-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/ludwig-ui/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/ludwig-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/ludwig-ui/merges","archive_url":"https://api.github.com/repos/sgmap/ludwig-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/ludwig-ui/downloads","issues_url":"https://api.github.com/repos/sgmap/ludwig-ui/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/ludwig-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/ludwig-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/ludwig-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/ludwig-ui/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/ludwig-ui/releases{/id}","created_at":"2015-01-22T16:31:07Z","updated_at":"2015-03-13T16:39:16Z","pushed_at":"2015-03-16T17:19:06Z","git_url":"git://github.com/sgmap/ludwig-ui.git","ssh_url":"git@github.com:sgmap/ludwig-ui.git","clone_url":"https://github.com/sgmap/ludwig-ui.git","svn_url":"https://github.com/sgmap/ludwig-ui","homepage":null,"size":504,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12"},"html":{"href":"https://github.com/sgmap/ludwig-ui/pull/12"},"issue":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/issues/12"},"comments":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/sgmap/ludwig-ui/statuses/6a0bd72452d2c61864c597a6c183ee208dd77671"}}}}