{"action":"created","comment":{"url":"https://api.github.com/repos/meanjs/mean/pulls/comments/36670116","id":36670116,"diff_hunk":"@@ -0,0 +1,82 @@\n+'use strict';\n+\n+var mongoose = require('mongoose'),\n+    User = mongoose.model('User');\n+\n+//If production only seed admin if it does not exist\n+if (process.env.NODE_ENV === 'production') {\n+    //Add Local Admin\n+    User.find({username: 'admin'}, function (err, users) {\n+        if (users.length === 0) {\n+            var user = new User({\n+                username: 'admin',\n+                password: 'test123',\n+                provider: 'local',\n+                email: 'admin@localhost.com',\n+                firstName: 'Admin',\n+                lastName: 'Local',\n+                displayName: 'Admin Local',\n+                roles: ['user', 'admin']\n+            });\n+            // Then save the user\n+            user.save(function (err) {\n+                if (err) {\n+                    console.log('Failed to add local admin');\n+                } else {\n+                    console.log('Local admin added');\n+                }\n+            });\n+        }\n+        else {\n+            console.log('Admin user exists');\n+        }\n+    });\n+}","path":"config/lib/seed.js","position":34,"original_position":34,"commit_id":"3ea51d8ced8d5b7aad3321bef94f72723094bff0","original_commit_id":"3ea51d8ced8d5b7aad3321bef94f72723094bff0","user":{"login":"ilanbiala","id":3695164,"avatar_url":"https://avatars.githubusercontent.com/u/3695164?v=3","gravatar_id":"","url":"https://api.github.com/users/ilanbiala","html_url":"https://github.com/ilanbiala","followers_url":"https://api.github.com/users/ilanbiala/followers","following_url":"https://api.github.com/users/ilanbiala/following{/other_user}","gists_url":"https://api.github.com/users/ilanbiala/gists{/gist_id}","starred_url":"https://api.github.com/users/ilanbiala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilanbiala/subscriptions","organizations_url":"https://api.github.com/users/ilanbiala/orgs","repos_url":"https://api.github.com/users/ilanbiala/repos","events_url":"https://api.github.com/users/ilanbiala/events{/privacy}","received_events_url":"https://api.github.com/users/ilanbiala/received_events","type":"User","site_admin":false},"body":"Formatting","created_at":"2015-08-10T18:56:07Z","updated_at":"2015-08-10T18:56:07Z","html_url":"https://github.com/meanjs/mean/pull/785#discussion_r36670116","pull_request_url":"https://api.github.com/repos/meanjs/mean/pulls/785","_links":{"self":{"href":"https://api.github.com/repos/meanjs/mean/pulls/comments/36670116"},"html":{"href":"https://github.com/meanjs/mean/pull/785#discussion_r36670116"},"pull_request":{"href":"https://api.github.com/repos/meanjs/mean/pulls/785"}}},"pull_request":{"url":"https://api.github.com/repos/meanjs/mean/pulls/785","id":42039885,"html_url":"https://github.com/meanjs/mean/pull/785","diff_url":"https://github.com/meanjs/mean/pull/785.diff","patch_url":"https://github.com/meanjs/mean/pull/785.patch","issue_url":"https://api.github.com/repos/meanjs/mean/issues/785","number":785,"state":"open","locked":false,"title":"Added database seeding for users in development","user":{"login":"trainerbill","id":3578259,"avatar_url":"https://avatars.githubusercontent.com/u/3578259?v=3","gravatar_id":"","url":"https://api.github.com/users/trainerbill","html_url":"https://github.com/trainerbill","followers_url":"https://api.github.com/users/trainerbill/followers","following_url":"https://api.github.com/users/trainerbill/following{/other_user}","gists_url":"https://api.github.com/users/trainerbill/gists{/gist_id}","starred_url":"https://api.github.com/users/trainerbill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trainerbill/subscriptions","organizations_url":"https://api.github.com/users/trainerbill/orgs","repos_url":"https://api.github.com/users/trainerbill/repos","events_url":"https://api.github.com/users/trainerbill/events{/privacy}","received_events_url":"https://api.github.com/users/trainerbill/received_events","type":"User","site_admin":false},"body":"use seedDB in the configs to add users to the database.  It removes the username user and admin and adds them back so the passwords should always be test123","created_at":"2015-08-10T16:39:19Z","updated_at":"2015-08-10T18:56:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce3c5116d56065e129eaf8c31a2f902f9c83947d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/meanjs/mean/pulls/785/commits","review_comments_url":"https://api.github.com/repos/meanjs/mean/pulls/785/comments","review_comment_url":"https://api.github.com/repos/meanjs/mean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meanjs/mean/issues/785/comments","statuses_url":"https://api.github.com/repos/meanjs/mean/statuses/3ea51d8ced8d5b7aad3321bef94f72723094bff0","head":{"label":"trainerbill:SeedDB","ref":"SeedDB","sha":"3ea51d8ced8d5b7aad3321bef94f72723094bff0","user":{"login":"trainerbill","id":3578259,"avatar_url":"https://avatars.githubusercontent.com/u/3578259?v=3","gravatar_id":"","url":"https://api.github.com/users/trainerbill","html_url":"https://github.com/trainerbill","followers_url":"https://api.github.com/users/trainerbill/followers","following_url":"https://api.github.com/users/trainerbill/following{/other_user}","gists_url":"https://api.github.com/users/trainerbill/gists{/gist_id}","starred_url":"https://api.github.com/users/trainerbill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trainerbill/subscriptions","organizations_url":"https://api.github.com/users/trainerbill/orgs","repos_url":"https://api.github.com/users/trainerbill/repos","events_url":"https://api.github.com/users/trainerbill/events{/privacy}","received_events_url":"https://api.github.com/users/trainerbill/received_events","type":"User","site_admin":false},"repo":{"id":35045185,"name":"mean","full_name":"trainerbill/mean","owner":{"login":"trainerbill","id":3578259,"avatar_url":"https://avatars.githubusercontent.com/u/3578259?v=3","gravatar_id":"","url":"https://api.github.com/users/trainerbill","html_url":"https://github.com/trainerbill","followers_url":"https://api.github.com/users/trainerbill/followers","following_url":"https://api.github.com/users/trainerbill/following{/other_user}","gists_url":"https://api.github.com/users/trainerbill/gists{/gist_id}","starred_url":"https://api.github.com/users/trainerbill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trainerbill/subscriptions","organizations_url":"https://api.github.com/users/trainerbill/orgs","repos_url":"https://api.github.com/users/trainerbill/repos","events_url":"https://api.github.com/users/trainerbill/events{/privacy}","received_events_url":"https://api.github.com/users/trainerbill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trainerbill/mean","description":"MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js - ","fork":true,"url":"https://api.github.com/repos/trainerbill/mean","forks_url":"https://api.github.com/repos/trainerbill/mean/forks","keys_url":"https://api.github.com/repos/trainerbill/mean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trainerbill/mean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trainerbill/mean/teams","hooks_url":"https://api.github.com/repos/trainerbill/mean/hooks","issue_events_url":"https://api.github.com/repos/trainerbill/mean/issues/events{/number}","events_url":"https://api.github.com/repos/trainerbill/mean/events","assignees_url":"https://api.github.com/repos/trainerbill/mean/assignees{/user}","branches_url":"https://api.github.com/repos/trainerbill/mean/branches{/branch}","tags_url":"https://api.github.com/repos/trainerbill/mean/tags","blobs_url":"https://api.github.com/repos/trainerbill/mean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trainerbill/mean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trainerbill/mean/git/refs{/sha}","trees_url":"https://api.github.com/repos/trainerbill/mean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trainerbill/mean/statuses/{sha}","languages_url":"https://api.github.com/repos/trainerbill/mean/languages","stargazers_url":"https://api.github.com/repos/trainerbill/mean/stargazers","contributors_url":"https://api.github.com/repos/trainerbill/mean/contributors","subscribers_url":"https://api.github.com/repos/trainerbill/mean/subscribers","subscription_url":"https://api.github.com/repos/trainerbill/mean/subscription","commits_url":"https://api.github.com/repos/trainerbill/mean/commits{/sha}","git_commits_url":"https://api.github.com/repos/trainerbill/mean/git/commits{/sha}","comments_url":"https://api.github.com/repos/trainerbill/mean/comments{/number}","issue_comment_url":"https://api.github.com/repos/trainerbill/mean/issues/comments{/number}","contents_url":"https://api.github.com/repos/trainerbill/mean/contents/{+path}","compare_url":"https://api.github.com/repos/trainerbill/mean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trainerbill/mean/merges","archive_url":"https://api.github.com/repos/trainerbill/mean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trainerbill/mean/downloads","issues_url":"https://api.github.com/repos/trainerbill/mean/issues{/number}","pulls_url":"https://api.github.com/repos/trainerbill/mean/pulls{/number}","milestones_url":"https://api.github.com/repos/trainerbill/mean/milestones{/number}","notifications_url":"https://api.github.com/repos/trainerbill/mean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trainerbill/mean/labels{/name}","releases_url":"https://api.github.com/repos/trainerbill/mean/releases{/id}","created_at":"2015-05-04T16:12:38Z","updated_at":"2015-05-04T16:12:39Z","pushed_at":"2015-08-10T17:54:05Z","git_url":"git://github.com/trainerbill/mean.git","ssh_url":"git@github.com:trainerbill/mean.git","clone_url":"https://github.com/trainerbill/mean.git","svn_url":"https://github.com/trainerbill/mean","homepage":"http://meanjs.org","size":2835,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"meanjs:master","ref":"master","sha":"c9591804810dcb83264ca7f94e57f997b31de84d","user":{"login":"meanjs","id":6232122,"avatar_url":"https://avatars.githubusercontent.com/u/6232122?v=3","gravatar_id":"","url":"https://api.github.com/users/meanjs","html_url":"https://github.com/meanjs","followers_url":"https://api.github.com/users/meanjs/followers","following_url":"https://api.github.com/users/meanjs/following{/other_user}","gists_url":"https://api.github.com/users/meanjs/gists{/gist_id}","starred_url":"https://api.github.com/users/meanjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meanjs/subscriptions","organizations_url":"https://api.github.com/users/meanjs/orgs","repos_url":"https://api.github.com/users/meanjs/repos","events_url":"https://api.github.com/users/meanjs/events{/privacy}","received_events_url":"https://api.github.com/users/meanjs/received_events","type":"Organization","site_admin":false},"repo":{"id":15508537,"name":"mean","full_name":"meanjs/mean","owner":{"login":"meanjs","id":6232122,"avatar_url":"https://avatars.githubusercontent.com/u/6232122?v=3","gravatar_id":"","url":"https://api.github.com/users/meanjs","html_url":"https://github.com/meanjs","followers_url":"https://api.github.com/users/meanjs/followers","following_url":"https://api.github.com/users/meanjs/following{/other_user}","gists_url":"https://api.github.com/users/meanjs/gists{/gist_id}","starred_url":"https://api.github.com/users/meanjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meanjs/subscriptions","organizations_url":"https://api.github.com/users/meanjs/orgs","repos_url":"https://api.github.com/users/meanjs/repos","events_url":"https://api.github.com/users/meanjs/events{/privacy}","received_events_url":"https://api.github.com/users/meanjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meanjs/mean","description":"MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js - ","fork":false,"url":"https://api.github.com/repos/meanjs/mean","forks_url":"https://api.github.com/repos/meanjs/mean/forks","keys_url":"https://api.github.com/repos/meanjs/mean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meanjs/mean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meanjs/mean/teams","hooks_url":"https://api.github.com/repos/meanjs/mean/hooks","issue_events_url":"https://api.github.com/repos/meanjs/mean/issues/events{/number}","events_url":"https://api.github.com/repos/meanjs/mean/events","assignees_url":"https://api.github.com/repos/meanjs/mean/assignees{/user}","branches_url":"https://api.github.com/repos/meanjs/mean/branches{/branch}","tags_url":"https://api.github.com/repos/meanjs/mean/tags","blobs_url":"https://api.github.com/repos/meanjs/mean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meanjs/mean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meanjs/mean/git/refs{/sha}","trees_url":"https://api.github.com/repos/meanjs/mean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meanjs/mean/statuses/{sha}","languages_url":"https://api.github.com/repos/meanjs/mean/languages","stargazers_url":"https://api.github.com/repos/meanjs/mean/stargazers","contributors_url":"https://api.github.com/repos/meanjs/mean/contributors","subscribers_url":"https://api.github.com/repos/meanjs/mean/subscribers","subscription_url":"https://api.github.com/repos/meanjs/mean/subscription","commits_url":"https://api.github.com/repos/meanjs/mean/commits{/sha}","git_commits_url":"https://api.github.com/repos/meanjs/mean/git/commits{/sha}","comments_url":"https://api.github.com/repos/meanjs/mean/comments{/number}","issue_comment_url":"https://api.github.com/repos/meanjs/mean/issues/comments{/number}","contents_url":"https://api.github.com/repos/meanjs/mean/contents/{+path}","compare_url":"https://api.github.com/repos/meanjs/mean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meanjs/mean/merges","archive_url":"https://api.github.com/repos/meanjs/mean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meanjs/mean/downloads","issues_url":"https://api.github.com/repos/meanjs/mean/issues{/number}","pulls_url":"https://api.github.com/repos/meanjs/mean/pulls{/number}","milestones_url":"https://api.github.com/repos/meanjs/mean/milestones{/number}","notifications_url":"https://api.github.com/repos/meanjs/mean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meanjs/mean/labels{/name}","releases_url":"https://api.github.com/repos/meanjs/mean/releases{/id}","created_at":"2013-12-29T13:01:15Z","updated_at":"2015-08-10T15:01:11Z","pushed_at":"2015-08-10T17:54:06Z","git_url":"git://github.com/meanjs/mean.git","ssh_url":"git@github.com:meanjs/mean.git","clone_url":"https://github.com/meanjs/mean.git","svn_url":"https://github.com/meanjs/mean","homepage":"http://meanjs.org","size":6560,"stargazers_count":2426,"watchers_count":2426,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":843,"mirror_url":null,"open_issues_count":91,"forks":843,"open_issues":91,"watchers":2426,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meanjs/mean/pulls/785"},"html":{"href":"https://github.com/meanjs/mean/pull/785"},"issue":{"href":"https://api.github.com/repos/meanjs/mean/issues/785"},"comments":{"href":"https://api.github.com/repos/meanjs/mean/issues/785/comments"},"review_comments":{"href":"https://api.github.com/repos/meanjs/mean/pulls/785/comments"},"review_comment":{"href":"https://api.github.com/repos/meanjs/mean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meanjs/mean/pulls/785/commits"},"statuses":{"href":"https://api.github.com/repos/meanjs/mean/statuses/3ea51d8ced8d5b7aad3321bef94f72723094bff0"}}}}