{"action":"created","comment":{"url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/comments/227035056","pull_request_review_id":166975404,"id":227035056,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzAzNTA1Ng==","diff_hunk":"@@ -1,8 +1,48 @@\n+import { createGame } from '../src/common/game';\n+import mongoose from 'mongoose';\n+\n const express = require('express');\n+const bodyParser = require('body-parser');\n+const cors = require('cors');\n+\n const app = express();\n \n-app.get('/', function(req, res) {\n-    res.send('Welcome to Labyrinth application!');\n+mongoose.Promise = global.Promise;\n+mongoose.connect('mongodb://mongodb/games').then(\n+    () => console.log('Database is connected'),\n+    err => {\n+        console.log('Cannot connect to the database\\n' + err);\n+    }\n+);\n+\n+app.use(bodyParser.json());\n+app.use(cors());\n+\n+const GameModel = require('./gameModel');\n+\n+app.get('/', (req, res) => res.status(200).json({ msg: 'Welcome to Labyrinth API server' }));\n+\n+app.post('/createGame', (req, res) => {","path":"server/app.js","position":27,"original_position":27,"commit_id":"6dcb24fe7c182ed6028f984f542672d21fa9827c","original_commit_id":"6dcb24fe7c182ed6028f984f542672d21fa9827c","user":{"login":"JulienMattiussi","id":39904906,"node_id":"MDQ6VXNlcjM5OTA0OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/39904906?v=4","gravatar_id":"","url":"https://api.github.com/users/JulienMattiussi","html_url":"https://github.com/JulienMattiussi","followers_url":"https://api.github.com/users/JulienMattiussi/followers","following_url":"https://api.github.com/users/JulienMattiussi/following{/other_user}","gists_url":"https://api.github.com/users/JulienMattiussi/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienMattiussi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienMattiussi/subscriptions","organizations_url":"https://api.github.com/users/JulienMattiussi/orgs","repos_url":"https://api.github.com/users/JulienMattiussi/repos","events_url":"https://api.github.com/users/JulienMattiussi/events{/privacy}","received_events_url":"https://api.github.com/users/JulienMattiussi/received_events","type":"User","site_admin":false},"body":"I think it's better if your app.js only have to manage diffrent services, but don't centralise all in one file.\r\nPrefer writing all your routes in a '/controllers' folder and import it here.","created_at":"2018-10-22T16:00:17Z","updated_at":"2018-10-22T16:15:17Z","html_url":"https://github.com/marmelab/labyrinth-react/pull/11#discussion_r227035056","pull_request_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/comments/227035056"},"html":{"href":"https://github.com/marmelab/labyrinth-react/pull/11#discussion_r227035056"},"pull_request":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11","id":224613740,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NjEzNzQw","html_url":"https://github.com/marmelab/labyrinth-react/pull/11","diff_url":"https://github.com/marmelab/labyrinth-react/pull/11.diff","patch_url":"https://github.com/marmelab/labyrinth-react/pull/11.patch","issue_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/11","number":11,"state":"open","locked":false,"title":"[RFR] Connect server and DB","user":{"login":"pemoreau","id":1090025,"node_id":"MDQ6VXNlcjEwOTAwMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1090025?v=4","gravatar_id":"","url":"https://api.github.com/users/pemoreau","html_url":"https://github.com/pemoreau","followers_url":"https://api.github.com/users/pemoreau/followers","following_url":"https://api.github.com/users/pemoreau/following{/other_user}","gists_url":"https://api.github.com/users/pemoreau/gists{/gist_id}","starred_url":"https://api.github.com/users/pemoreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pemoreau/subscriptions","organizations_url":"https://api.github.com/users/pemoreau/orgs","repos_url":"https://api.github.com/users/pemoreau/repos","events_url":"https://api.github.com/users/pemoreau/events{/privacy}","received_events_url":"https://api.github.com/users/pemoreau/received_events","type":"User","site_admin":false},"body":"- [x] use server to create a Game\r\n- [x] connect a DB\r\n- [x] store the created game in DB","created_at":"2018-10-22T08:13:50Z","updated_at":"2018-10-22T16:15:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e020c611f17cb736aa7d7eeecefa763f9eabf44b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11/commits","review_comments_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11/comments","review_comment_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/11/comments","statuses_url":"https://api.github.com/repos/marmelab/labyrinth-react/statuses/6dcb24fe7c182ed6028f984f542672d21fa9827c","head":{"label":"marmelab:connect_server","ref":"connect_server","sha":"6dcb24fe7c182ed6028f984f542672d21fa9827c","user":{"login":"marmelab","id":3116319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMTYzMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":153063390,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwNjMzOTA=","name":"labyrinth-react","full_name":"marmelab/labyrinth-react","private":false,"owner":{"login":"marmelab","id":3116319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMTYzMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/marmelab/labyrinth-react","description":"Labyrinth game using Node and React","fork":false,"url":"https://api.github.com/repos/marmelab/labyrinth-react","forks_url":"https://api.github.com/repos/marmelab/labyrinth-react/forks","keys_url":"https://api.github.com/repos/marmelab/labyrinth-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/labyrinth-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/labyrinth-react/teams","hooks_url":"https://api.github.com/repos/marmelab/labyrinth-react/hooks","issue_events_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/labyrinth-react/events","assignees_url":"https://api.github.com/repos/marmelab/labyrinth-react/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/labyrinth-react/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/labyrinth-react/tags","blobs_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/labyrinth-react/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/labyrinth-react/languages","stargazers_url":"https://api.github.com/repos/marmelab/labyrinth-react/stargazers","contributors_url":"https://api.github.com/repos/marmelab/labyrinth-react/contributors","subscribers_url":"https://api.github.com/repos/marmelab/labyrinth-react/subscribers","subscription_url":"https://api.github.com/repos/marmelab/labyrinth-react/subscription","commits_url":"https://api.github.com/repos/marmelab/labyrinth-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/labyrinth-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/labyrinth-react/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/labyrinth-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/labyrinth-react/merges","archive_url":"https://api.github.com/repos/marmelab/labyrinth-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/labyrinth-react/downloads","issues_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/labyrinth-react/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/labyrinth-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/labyrinth-react/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/labyrinth-react/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/labyrinth-react/deployments","created_at":"2018-10-15T06:28:46Z","updated_at":"2018-10-19T15:24:50Z","pushed_at":"2018-10-22T14:39:52Z","git_url":"git://github.com/marmelab/labyrinth-react.git","ssh_url":"git@github.com:marmelab/labyrinth-react.git","clone_url":"https://github.com/marmelab/labyrinth-react.git","svn_url":"https://github.com/marmelab/labyrinth-react","homepage":"","size":332,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"marmelab:master","ref":"master","sha":"2002fec97f509528094f53407ad548481c214e87","user":{"login":"marmelab","id":3116319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMTYzMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":153063390,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwNjMzOTA=","name":"labyrinth-react","full_name":"marmelab/labyrinth-react","private":false,"owner":{"login":"marmelab","id":3116319,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMTYzMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3116319?v=4","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/marmelab/labyrinth-react","description":"Labyrinth game using Node and React","fork":false,"url":"https://api.github.com/repos/marmelab/labyrinth-react","forks_url":"https://api.github.com/repos/marmelab/labyrinth-react/forks","keys_url":"https://api.github.com/repos/marmelab/labyrinth-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/labyrinth-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/labyrinth-react/teams","hooks_url":"https://api.github.com/repos/marmelab/labyrinth-react/hooks","issue_events_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/labyrinth-react/events","assignees_url":"https://api.github.com/repos/marmelab/labyrinth-react/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/labyrinth-react/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/labyrinth-react/tags","blobs_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/labyrinth-react/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/labyrinth-react/languages","stargazers_url":"https://api.github.com/repos/marmelab/labyrinth-react/stargazers","contributors_url":"https://api.github.com/repos/marmelab/labyrinth-react/contributors","subscribers_url":"https://api.github.com/repos/marmelab/labyrinth-react/subscribers","subscription_url":"https://api.github.com/repos/marmelab/labyrinth-react/subscription","commits_url":"https://api.github.com/repos/marmelab/labyrinth-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/labyrinth-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/labyrinth-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/labyrinth-react/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/labyrinth-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/labyrinth-react/merges","archive_url":"https://api.github.com/repos/marmelab/labyrinth-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/labyrinth-react/downloads","issues_url":"https://api.github.com/repos/marmelab/labyrinth-react/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/labyrinth-react/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/labyrinth-react/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/labyrinth-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/labyrinth-react/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/labyrinth-react/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/labyrinth-react/deployments","created_at":"2018-10-15T06:28:46Z","updated_at":"2018-10-19T15:24:50Z","pushed_at":"2018-10-22T14:39:52Z","git_url":"git://github.com/marmelab/labyrinth-react.git","ssh_url":"git@github.com:marmelab/labyrinth-react.git","clone_url":"https://github.com/marmelab/labyrinth-react.git","svn_url":"https://github.com/marmelab/labyrinth-react","homepage":"","size":332,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11"},"html":{"href":"https://github.com/marmelab/labyrinth-react/pull/11"},"issue":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/issues/11"},"comments":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/marmelab/labyrinth-react/statuses/6dcb24fe7c182ed6028f984f542672d21fa9827c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"JulienMattiussi"}}