{"action":"created","comment":{"url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/comments/179985202","pull_request_review_id":110326209,"id":179985202,"diff_hunk":"@@ -13,80 +13,89 @@ import {InspirationRouter} from './routes/inspirationRouter';\n \n export const app = express();\n export const httpServer = require('http').createServer(app);\n-const port = process.env.PORT || 3001;\n+\n+/* 8080 Port is the default for Openshift deployment */\n+const port = process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || '3001',\n+      ip = process.env.IP || process.env.OPENSHIFT_NODEJS_IP || 'localhost';\n+\n const bodyParser = require('body-parser');\n const session = require('express-session');\n const env = process.env.node_env;\n \n (async function(){\n-  let mysqlDB = await connectToMysqlDB();\n-  let userModel = await UserModel(mysqlDB.sequalizeDB);  \n-  let inspirationModel = await InspirationModel(mysqlDB.sequalizeDB);\n-  let passport = await passportStrat(userModel);\n+  let mysqlDB = await connectToMysqlDB().then((value) =>{return value}, (err) => {return null});\n \n-  app.use(bodyParser.json());\n+  if(mysqlDB){\n+    let userModel = await UserModel(mysqlDB.sequalizeDB);  \n+    let inspirationModel = await InspirationModel(mysqlDB.sequalizeDB);\n+    let passport = await passportStrat(userModel);\n \n-  // Passport requirements\n-  // Not secure must change before production\n-  app.use(session({ \n-    secret: 'jk_travelhive',\n-    resave: false,\n-    saveUninitialized: false,\n-  }));\n-  app.use(passport.initialize());\n-  app.use(passport.session());\n+    app.use(bodyParser.json());\n \n-  app.use(function (req, res, next) {\n-    res.header('Access-Control-Allow-Credentials', true);\n-    \n-    /******* Change below line to restrict to our website origin *********/    \n-    res.header('Access-Control-Allow-Origin', req.headers.origin);    \n-    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,PATCH');\n-    res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');\n-    next();\n-   });\n+    // Passport requirements\n+    // Not secure must change before production\n+    app.use(session({ \n+      secret: env.EXPRESS_SECRET || 'jk_travelhive',","path":"server/server.js","position":50,"original_position":50,"commit_id":"a46bcc90425d031da3def8ee3fa0bbe765f494f3","original_commit_id":"a46bcc90425d031da3def8ee3fa0bbe765f494f3","user":{"login":"reggieroby","id":2244915,"avatar_url":"https://avatars3.githubusercontent.com/u/2244915?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieroby","html_url":"https://github.com/reggieroby","followers_url":"https://api.github.com/users/reggieroby/followers","following_url":"https://api.github.com/users/reggieroby/following{/other_user}","gists_url":"https://api.github.com/users/reggieroby/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieroby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieroby/subscriptions","organizations_url":"https://api.github.com/users/reggieroby/orgs","repos_url":"https://api.github.com/users/reggieroby/repos","events_url":"https://api.github.com/users/reggieroby/events{/privacy}","received_events_url":"https://api.github.com/users/reggieroby/received_events","type":"User","site_admin":false},"body":"thats a nice addition.","created_at":"2018-04-09T04:33:21Z","updated_at":"2018-04-09T04:33:21Z","html_url":"https://github.com/reggieroby/travel_hive/pull/85#discussion_r179985202","pull_request_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/comments/179985202"},"html":{"href":"https://github.com/reggieroby/travel_hive/pull/85#discussion_r179985202"},"pull_request":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85","id":180148613,"html_url":"https://github.com/reggieroby/travel_hive/pull/85","diff_url":"https://github.com/reggieroby/travel_hive/pull/85.diff","patch_url":"https://github.com/reggieroby/travel_hive/pull/85.patch","issue_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/85","number":85,"state":"open","locked":false,"title":"Issue 83 revamp backend","user":{"login":"jvaughn575","id":4425225,"avatar_url":"https://avatars3.githubusercontent.com/u/4425225?v=4","gravatar_id":"","url":"https://api.github.com/users/jvaughn575","html_url":"https://github.com/jvaughn575","followers_url":"https://api.github.com/users/jvaughn575/followers","following_url":"https://api.github.com/users/jvaughn575/following{/other_user}","gists_url":"https://api.github.com/users/jvaughn575/gists{/gist_id}","starred_url":"https://api.github.com/users/jvaughn575/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvaughn575/subscriptions","organizations_url":"https://api.github.com/users/jvaughn575/orgs","repos_url":"https://api.github.com/users/jvaughn575/repos","events_url":"https://api.github.com/users/jvaughn575/events{/privacy}","received_events_url":"https://api.github.com/users/jvaughn575/received_events","type":"User","site_admin":false},"body":"Took a little bit of working through but I think I improved the build process slightly for the openshift build. Now using environmental variables we can also set the Allow-control-access-origin headers to only accept requests from our client. I will publish a list of env variables to set when deploying the server soon.","created_at":"2018-04-08T08:56:17Z","updated_at":"2018-04-09T04:33:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7a0f47866e498219e9f8116a5c158ef64096695","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85/commits","review_comments_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85/comments","review_comment_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/85/comments","statuses_url":"https://api.github.com/repos/reggieroby/travel_hive/statuses/a46bcc90425d031da3def8ee3fa0bbe765f494f3","head":{"label":"reggieroby:issue_83_revamp_backend","ref":"issue_83_revamp_backend","sha":"a46bcc90425d031da3def8ee3fa0bbe765f494f3","user":{"login":"reggieroby","id":2244915,"avatar_url":"https://avatars3.githubusercontent.com/u/2244915?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieroby","html_url":"https://github.com/reggieroby","followers_url":"https://api.github.com/users/reggieroby/followers","following_url":"https://api.github.com/users/reggieroby/following{/other_user}","gists_url":"https://api.github.com/users/reggieroby/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieroby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieroby/subscriptions","organizations_url":"https://api.github.com/users/reggieroby/orgs","repos_url":"https://api.github.com/users/reggieroby/repos","events_url":"https://api.github.com/users/reggieroby/events{/privacy}","received_events_url":"https://api.github.com/users/reggieroby/received_events","type":"User","site_admin":false},"repo":{"id":113075560,"name":"travel_hive","full_name":"reggieroby/travel_hive","owner":{"login":"reggieroby","id":2244915,"avatar_url":"https://avatars3.githubusercontent.com/u/2244915?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieroby","html_url":"https://github.com/reggieroby","followers_url":"https://api.github.com/users/reggieroby/followers","following_url":"https://api.github.com/users/reggieroby/following{/other_user}","gists_url":"https://api.github.com/users/reggieroby/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieroby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieroby/subscriptions","organizations_url":"https://api.github.com/users/reggieroby/orgs","repos_url":"https://api.github.com/users/reggieroby/repos","events_url":"https://api.github.com/users/reggieroby/events{/privacy}","received_events_url":"https://api.github.com/users/reggieroby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reggieroby/travel_hive","description":"Plan your trip","fork":false,"url":"https://api.github.com/repos/reggieroby/travel_hive","forks_url":"https://api.github.com/repos/reggieroby/travel_hive/forks","keys_url":"https://api.github.com/repos/reggieroby/travel_hive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reggieroby/travel_hive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reggieroby/travel_hive/teams","hooks_url":"https://api.github.com/repos/reggieroby/travel_hive/hooks","issue_events_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/events{/number}","events_url":"https://api.github.com/repos/reggieroby/travel_hive/events","assignees_url":"https://api.github.com/repos/reggieroby/travel_hive/assignees{/user}","branches_url":"https://api.github.com/repos/reggieroby/travel_hive/branches{/branch}","tags_url":"https://api.github.com/repos/reggieroby/travel_hive/tags","blobs_url":"https://api.github.com/repos/reggieroby/travel_hive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reggieroby/travel_hive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reggieroby/travel_hive/git/refs{/sha}","trees_url":"https://api.github.com/repos/reggieroby/travel_hive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reggieroby/travel_hive/statuses/{sha}","languages_url":"https://api.github.com/repos/reggieroby/travel_hive/languages","stargazers_url":"https://api.github.com/repos/reggieroby/travel_hive/stargazers","contributors_url":"https://api.github.com/repos/reggieroby/travel_hive/contributors","subscribers_url":"https://api.github.com/repos/reggieroby/travel_hive/subscribers","subscription_url":"https://api.github.com/repos/reggieroby/travel_hive/subscription","commits_url":"https://api.github.com/repos/reggieroby/travel_hive/commits{/sha}","git_commits_url":"https://api.github.com/repos/reggieroby/travel_hive/git/commits{/sha}","comments_url":"https://api.github.com/repos/reggieroby/travel_hive/comments{/number}","issue_comment_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/comments{/number}","contents_url":"https://api.github.com/repos/reggieroby/travel_hive/contents/{+path}","compare_url":"https://api.github.com/repos/reggieroby/travel_hive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reggieroby/travel_hive/merges","archive_url":"https://api.github.com/repos/reggieroby/travel_hive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reggieroby/travel_hive/downloads","issues_url":"https://api.github.com/repos/reggieroby/travel_hive/issues{/number}","pulls_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls{/number}","milestones_url":"https://api.github.com/repos/reggieroby/travel_hive/milestones{/number}","notifications_url":"https://api.github.com/repos/reggieroby/travel_hive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reggieroby/travel_hive/labels{/name}","releases_url":"https://api.github.com/repos/reggieroby/travel_hive/releases{/id}","deployments_url":"https://api.github.com/repos/reggieroby/travel_hive/deployments","created_at":"2017-12-04T17:50:34Z","updated_at":"2018-04-07T16:57:41Z","pushed_at":"2018-04-09T02:24:10Z","git_url":"git://github.com/reggieroby/travel_hive.git","ssh_url":"git@github.com:reggieroby/travel_hive.git","clone_url":"https://github.com/reggieroby/travel_hive.git","svn_url":"https://github.com/reggieroby/travel_hive","homepage":"https://travel-hive.projectid8.com","size":1483,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":20,"license":null,"forks":1,"open_issues":20,"watchers":2,"default_branch":"master"}},"base":{"label":"reggieroby:master","ref":"master","sha":"384ca4cf88be973d1ad3df433f64d6169ad1f822","user":{"login":"reggieroby","id":2244915,"avatar_url":"https://avatars3.githubusercontent.com/u/2244915?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieroby","html_url":"https://github.com/reggieroby","followers_url":"https://api.github.com/users/reggieroby/followers","following_url":"https://api.github.com/users/reggieroby/following{/other_user}","gists_url":"https://api.github.com/users/reggieroby/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieroby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieroby/subscriptions","organizations_url":"https://api.github.com/users/reggieroby/orgs","repos_url":"https://api.github.com/users/reggieroby/repos","events_url":"https://api.github.com/users/reggieroby/events{/privacy}","received_events_url":"https://api.github.com/users/reggieroby/received_events","type":"User","site_admin":false},"repo":{"id":113075560,"name":"travel_hive","full_name":"reggieroby/travel_hive","owner":{"login":"reggieroby","id":2244915,"avatar_url":"https://avatars3.githubusercontent.com/u/2244915?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieroby","html_url":"https://github.com/reggieroby","followers_url":"https://api.github.com/users/reggieroby/followers","following_url":"https://api.github.com/users/reggieroby/following{/other_user}","gists_url":"https://api.github.com/users/reggieroby/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieroby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieroby/subscriptions","organizations_url":"https://api.github.com/users/reggieroby/orgs","repos_url":"https://api.github.com/users/reggieroby/repos","events_url":"https://api.github.com/users/reggieroby/events{/privacy}","received_events_url":"https://api.github.com/users/reggieroby/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reggieroby/travel_hive","description":"Plan your trip","fork":false,"url":"https://api.github.com/repos/reggieroby/travel_hive","forks_url":"https://api.github.com/repos/reggieroby/travel_hive/forks","keys_url":"https://api.github.com/repos/reggieroby/travel_hive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reggieroby/travel_hive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reggieroby/travel_hive/teams","hooks_url":"https://api.github.com/repos/reggieroby/travel_hive/hooks","issue_events_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/events{/number}","events_url":"https://api.github.com/repos/reggieroby/travel_hive/events","assignees_url":"https://api.github.com/repos/reggieroby/travel_hive/assignees{/user}","branches_url":"https://api.github.com/repos/reggieroby/travel_hive/branches{/branch}","tags_url":"https://api.github.com/repos/reggieroby/travel_hive/tags","blobs_url":"https://api.github.com/repos/reggieroby/travel_hive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reggieroby/travel_hive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reggieroby/travel_hive/git/refs{/sha}","trees_url":"https://api.github.com/repos/reggieroby/travel_hive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reggieroby/travel_hive/statuses/{sha}","languages_url":"https://api.github.com/repos/reggieroby/travel_hive/languages","stargazers_url":"https://api.github.com/repos/reggieroby/travel_hive/stargazers","contributors_url":"https://api.github.com/repos/reggieroby/travel_hive/contributors","subscribers_url":"https://api.github.com/repos/reggieroby/travel_hive/subscribers","subscription_url":"https://api.github.com/repos/reggieroby/travel_hive/subscription","commits_url":"https://api.github.com/repos/reggieroby/travel_hive/commits{/sha}","git_commits_url":"https://api.github.com/repos/reggieroby/travel_hive/git/commits{/sha}","comments_url":"https://api.github.com/repos/reggieroby/travel_hive/comments{/number}","issue_comment_url":"https://api.github.com/repos/reggieroby/travel_hive/issues/comments{/number}","contents_url":"https://api.github.com/repos/reggieroby/travel_hive/contents/{+path}","compare_url":"https://api.github.com/repos/reggieroby/travel_hive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reggieroby/travel_hive/merges","archive_url":"https://api.github.com/repos/reggieroby/travel_hive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reggieroby/travel_hive/downloads","issues_url":"https://api.github.com/repos/reggieroby/travel_hive/issues{/number}","pulls_url":"https://api.github.com/repos/reggieroby/travel_hive/pulls{/number}","milestones_url":"https://api.github.com/repos/reggieroby/travel_hive/milestones{/number}","notifications_url":"https://api.github.com/repos/reggieroby/travel_hive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reggieroby/travel_hive/labels{/name}","releases_url":"https://api.github.com/repos/reggieroby/travel_hive/releases{/id}","deployments_url":"https://api.github.com/repos/reggieroby/travel_hive/deployments","created_at":"2017-12-04T17:50:34Z","updated_at":"2018-04-07T16:57:41Z","pushed_at":"2018-04-09T02:24:10Z","git_url":"git://github.com/reggieroby/travel_hive.git","ssh_url":"git@github.com:reggieroby/travel_hive.git","clone_url":"https://github.com/reggieroby/travel_hive.git","svn_url":"https://github.com/reggieroby/travel_hive","homepage":"https://travel-hive.projectid8.com","size":1483,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":20,"license":null,"forks":1,"open_issues":20,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85"},"html":{"href":"https://github.com/reggieroby/travel_hive/pull/85"},"issue":{"href":"https://api.github.com/repos/reggieroby/travel_hive/issues/85"},"comments":{"href":"https://api.github.com/repos/reggieroby/travel_hive/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reggieroby/travel_hive/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/reggieroby/travel_hive/statuses/a46bcc90425d031da3def8ee3fa0bbe765f494f3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"reggieroby"}}