{"action":"created","comment":{"url":"https://api.github.com/repos/satyam1812/todo/pulls/comments/166588377","pull_request_review_id":94672526,"id":166588377,"diff_hunk":"@@ -0,0 +1,386 @@\n+var express = require(\"express\");\n+var path = require(\"path\");\n+var app = express();\n+const fileUpload = require('express-fileupload');\n+var mysql = require('mysql');\n+var md5 = require('md5');\n+var bodyParser = require('body-parser');\n+var multer = require('multer');\n+\n+app.use(express.static(path.join(__dirname, \"views\")));\n+app.use(express.static(path.join(__dirname, \"uploads\")));\n+\n+app.use(bodyParser.urlencoded({\n+    extended: true\n+}));\n+app.use(bodyParser.json());\n+\n+\n+var storage = multer.diskStorage({\n+    destination: function(req, file, callback) {\n+        callback(null, './uploads/user');\n+    },\n+    filename: function(req, file, callback) {\n+        var fileUniqueName = md5(Date.now());\n+        callback(null,  fileUniqueName + path.extname(file.originalname));\n+    }\n+});\n+\n+var upload = multer({ storage: storage });\n+\n+\n+//---------------------FOR DATABASE CONNECTION-----------------------------------------------//\n+var connection = mysql.createConnection({\n+\thost     : 'localhost',\n+\tuser     : 'root',\n+\tpassword : '',\n+\tdatabase : 'fluper_user'\n+});\n+ \n+connection.connect(function(err){\n+  if (err) {\n+    console.error('error connecting: ' + err.stack);\n+    return;\n+  }\n+  console.log('database working fine');\n+});\n+ \n+\n+\n+//-------------------------For adminlogin------------------------------------------------//\n+\n+app.post('/adminlogin', function(req, res) {\n+\tvar email = req.body.email;\n+\tvar password = req.body.password;\n+\n+\tvar sql = \"SELECT * FROM `admin` WHERE `emailId`=? AND `password`=?\";\n+\tvar password = md5(password);\n+\tvar values = [email,password];\n+\tconsole.log(values);\n+\n+\tconnection.query(sql, values, function(err, result){\n+\t\tconsole.log(err);\n+\t\tconsole.log(result);\n+\t\tif (err) {\n+\t\t\tconsole.log(err);\n+\t\t} else {\n+\t\t\tif(result.length>0)\n+\t\t\t\t{\n+\t\t\t\t\tresult[0].password=\"\";\n+\t\t\t\t\tvar response={\n+\t\t\t\t\t\tstatus:1, \n+\t\t\t\t\t\tresponse: result[0]\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tres.send(response);\n+\t\t\t\t}\n+\t\t\t\telse{\n+\t\t\t\t\tvar response ={\n+\t\t\t\t\t\tstatus:0,\n+\n+\t\t\t\t\t\tresponse:\"invalid cretdential\"\n+\n+\t\t\t\t\t}\n+\t\t\t\t\tres.send(response);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t});\n+});\n+\n+//-------------------------For userlogin------------------------------------------------//\n+\n+app.post('/userlogin', function(req, res) {\n+\tvar email = req.body.email;\n+\tvar password = req.body.password;\n+\n+\tvar sql = \"SELECT * FROM `user1` WHERE `emailId`=? AND `password`=?\";\n+\tvar password = md5(password);\n+\tvar values = [email,password];\n+\tconsole.log(values);\n+\n+\tconnection.query(sql, values, function(err, result){\n+\t\tconsole.log(err);\n+\t\tconsole.log(result);\n+\t\tif (err) {\n+\t\t\tconsole.log(err);\n+\t\t} else {\n+\t\t\tif(result.length>0)\n+\t\t\t\t{\n+\t\t\t\t\tresult[0].password=\"\";\n+\t\t\t\t\tvar response={\n+\t\t\t\t\t\tstatus:1, \n+\t\t\t\t\t\tresponse: result[0]\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tres.send(response);\n+\t\t\t\t}\n+\t\t\t\telse{\n+\t\t\t\t\tvar response ={\n+\t\t\t\t\t\tstatus:0,\n+\n+\t\t\t\t\t\tresponse:\"invalid cretdential\"\n+\n+\t\t\t\t\t}\n+\t\t\t\t\tres.send(response);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t});\n+});\n+\n+\n+ //----------------------------For signup----------------------------------------------//\n+app.post('/adminsignup', function(req, res) {\n+\tvar name = req.body.name;\n+\tvar email = req.body.email;\n+\tvar password = req.body.password;\n+\tvar contact  = req.body.contact;\n+\t  var text = \"\";\n+    var possible = \"123456789\";","path":"app.js","position":138,"original_position":138,"commit_id":"3d3c51448a5f5b9fefdda3ee87de7aaf06f32eee","original_commit_id":"3d3c51448a5f5b9fefdda3ee87de7aaf06f32eee","user":{"login":"shekhartyagi26","id":21354153,"avatar_url":"https://avatars2.githubusercontent.com/u/21354153?v=4","gravatar_id":"","url":"https://api.github.com/users/shekhartyagi26","html_url":"https://github.com/shekhartyagi26","followers_url":"https://api.github.com/users/shekhartyagi26/followers","following_url":"https://api.github.com/users/shekhartyagi26/following{/other_user}","gists_url":"https://api.github.com/users/shekhartyagi26/gists{/gist_id}","starred_url":"https://api.github.com/users/shekhartyagi26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shekhartyagi26/subscriptions","organizations_url":"https://api.github.com/users/shekhartyagi26/orgs","repos_url":"https://api.github.com/users/shekhartyagi26/repos","events_url":"https://api.github.com/users/shekhartyagi26/events{/privacy}","received_events_url":"https://api.github.com/users/shekhartyagi26/received_events","type":"User","site_admin":false},"body":"why possible is hard coded here","created_at":"2018-02-07T11:20:47Z","updated_at":"2018-02-07T11:25:41Z","html_url":"https://github.com/satyam1812/todo/pull/1#discussion_r166588377","pull_request_url":"https://api.github.com/repos/satyam1812/todo/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/comments/166588377"},"html":{"href":"https://github.com/satyam1812/todo/pull/1#discussion_r166588377"},"pull_request":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/satyam1812/todo/pulls/1","id":167661661,"html_url":"https://github.com/satyam1812/todo/pull/1","diff_url":"https://github.com/satyam1812/todo/pull/1.diff","patch_url":"https://github.com/satyam1812/todo/pull/1.patch","issue_url":"https://api.github.com/repos/satyam1812/todo/issues/1","number":1,"state":"open","locked":false,"title":"create a  todo task web application for CURD operation.","user":{"login":"satyam1812","id":36226742,"avatar_url":"https://avatars3.githubusercontent.com/u/36226742?v=4","gravatar_id":"","url":"https://api.github.com/users/satyam1812","html_url":"https://github.com/satyam1812","followers_url":"https://api.github.com/users/satyam1812/followers","following_url":"https://api.github.com/users/satyam1812/following{/other_user}","gists_url":"https://api.github.com/users/satyam1812/gists{/gist_id}","starred_url":"https://api.github.com/users/satyam1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satyam1812/subscriptions","organizations_url":"https://api.github.com/users/satyam1812/orgs","repos_url":"https://api.github.com/users/satyam1812/repos","events_url":"https://api.github.com/users/satyam1812/events{/privacy}","received_events_url":"https://api.github.com/users/satyam1812/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-07T11:04:48Z","updated_at":"2018-02-07T11:25:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04f574b0d25811f2d8afc70f4f6ff4840f7d30fb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/satyam1812/todo/pulls/1/commits","review_comments_url":"https://api.github.com/repos/satyam1812/todo/pulls/1/comments","review_comment_url":"https://api.github.com/repos/satyam1812/todo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/satyam1812/todo/issues/1/comments","statuses_url":"https://api.github.com/repos/satyam1812/todo/statuses/3d3c51448a5f5b9fefdda3ee87de7aaf06f32eee","head":{"label":"satyam1812:develop","ref":"develop","sha":"3d3c51448a5f5b9fefdda3ee87de7aaf06f32eee","user":{"login":"satyam1812","id":36226742,"avatar_url":"https://avatars3.githubusercontent.com/u/36226742?v=4","gravatar_id":"","url":"https://api.github.com/users/satyam1812","html_url":"https://github.com/satyam1812","followers_url":"https://api.github.com/users/satyam1812/followers","following_url":"https://api.github.com/users/satyam1812/following{/other_user}","gists_url":"https://api.github.com/users/satyam1812/gists{/gist_id}","starred_url":"https://api.github.com/users/satyam1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satyam1812/subscriptions","organizations_url":"https://api.github.com/users/satyam1812/orgs","repos_url":"https://api.github.com/users/satyam1812/repos","events_url":"https://api.github.com/users/satyam1812/events{/privacy}","received_events_url":"https://api.github.com/users/satyam1812/received_events","type":"User","site_admin":false},"repo":{"id":120599429,"name":"todo","full_name":"satyam1812/todo","owner":{"login":"satyam1812","id":36226742,"avatar_url":"https://avatars3.githubusercontent.com/u/36226742?v=4","gravatar_id":"","url":"https://api.github.com/users/satyam1812","html_url":"https://github.com/satyam1812","followers_url":"https://api.github.com/users/satyam1812/followers","following_url":"https://api.github.com/users/satyam1812/following{/other_user}","gists_url":"https://api.github.com/users/satyam1812/gists{/gist_id}","starred_url":"https://api.github.com/users/satyam1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satyam1812/subscriptions","organizations_url":"https://api.github.com/users/satyam1812/orgs","repos_url":"https://api.github.com/users/satyam1812/repos","events_url":"https://api.github.com/users/satyam1812/events{/privacy}","received_events_url":"https://api.github.com/users/satyam1812/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/satyam1812/todo","description":null,"fork":false,"url":"https://api.github.com/repos/satyam1812/todo","forks_url":"https://api.github.com/repos/satyam1812/todo/forks","keys_url":"https://api.github.com/repos/satyam1812/todo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/satyam1812/todo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/satyam1812/todo/teams","hooks_url":"https://api.github.com/repos/satyam1812/todo/hooks","issue_events_url":"https://api.github.com/repos/satyam1812/todo/issues/events{/number}","events_url":"https://api.github.com/repos/satyam1812/todo/events","assignees_url":"https://api.github.com/repos/satyam1812/todo/assignees{/user}","branches_url":"https://api.github.com/repos/satyam1812/todo/branches{/branch}","tags_url":"https://api.github.com/repos/satyam1812/todo/tags","blobs_url":"https://api.github.com/repos/satyam1812/todo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/satyam1812/todo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/satyam1812/todo/git/refs{/sha}","trees_url":"https://api.github.com/repos/satyam1812/todo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/satyam1812/todo/statuses/{sha}","languages_url":"https://api.github.com/repos/satyam1812/todo/languages","stargazers_url":"https://api.github.com/repos/satyam1812/todo/stargazers","contributors_url":"https://api.github.com/repos/satyam1812/todo/contributors","subscribers_url":"https://api.github.com/repos/satyam1812/todo/subscribers","subscription_url":"https://api.github.com/repos/satyam1812/todo/subscription","commits_url":"https://api.github.com/repos/satyam1812/todo/commits{/sha}","git_commits_url":"https://api.github.com/repos/satyam1812/todo/git/commits{/sha}","comments_url":"https://api.github.com/repos/satyam1812/todo/comments{/number}","issue_comment_url":"https://api.github.com/repos/satyam1812/todo/issues/comments{/number}","contents_url":"https://api.github.com/repos/satyam1812/todo/contents/{+path}","compare_url":"https://api.github.com/repos/satyam1812/todo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/satyam1812/todo/merges","archive_url":"https://api.github.com/repos/satyam1812/todo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/satyam1812/todo/downloads","issues_url":"https://api.github.com/repos/satyam1812/todo/issues{/number}","pulls_url":"https://api.github.com/repos/satyam1812/todo/pulls{/number}","milestones_url":"https://api.github.com/repos/satyam1812/todo/milestones{/number}","notifications_url":"https://api.github.com/repos/satyam1812/todo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/satyam1812/todo/labels{/name}","releases_url":"https://api.github.com/repos/satyam1812/todo/releases{/id}","deployments_url":"https://api.github.com/repos/satyam1812/todo/deployments","created_at":"2018-02-07T10:20:31Z","updated_at":"2018-02-07T10:20:31Z","pushed_at":"2018-02-07T11:04:49Z","git_url":"git://github.com/satyam1812/todo.git","ssh_url":"git@github.com:satyam1812/todo.git","clone_url":"https://github.com/satyam1812/todo.git","svn_url":"https://github.com/satyam1812/todo","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"satyam1812:master","ref":"master","sha":"b0e206e0dd46e3ddc9c59805aa79eb08346bdc64","user":{"login":"satyam1812","id":36226742,"avatar_url":"https://avatars3.githubusercontent.com/u/36226742?v=4","gravatar_id":"","url":"https://api.github.com/users/satyam1812","html_url":"https://github.com/satyam1812","followers_url":"https://api.github.com/users/satyam1812/followers","following_url":"https://api.github.com/users/satyam1812/following{/other_user}","gists_url":"https://api.github.com/users/satyam1812/gists{/gist_id}","starred_url":"https://api.github.com/users/satyam1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satyam1812/subscriptions","organizations_url":"https://api.github.com/users/satyam1812/orgs","repos_url":"https://api.github.com/users/satyam1812/repos","events_url":"https://api.github.com/users/satyam1812/events{/privacy}","received_events_url":"https://api.github.com/users/satyam1812/received_events","type":"User","site_admin":false},"repo":{"id":120599429,"name":"todo","full_name":"satyam1812/todo","owner":{"login":"satyam1812","id":36226742,"avatar_url":"https://avatars3.githubusercontent.com/u/36226742?v=4","gravatar_id":"","url":"https://api.github.com/users/satyam1812","html_url":"https://github.com/satyam1812","followers_url":"https://api.github.com/users/satyam1812/followers","following_url":"https://api.github.com/users/satyam1812/following{/other_user}","gists_url":"https://api.github.com/users/satyam1812/gists{/gist_id}","starred_url":"https://api.github.com/users/satyam1812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satyam1812/subscriptions","organizations_url":"https://api.github.com/users/satyam1812/orgs","repos_url":"https://api.github.com/users/satyam1812/repos","events_url":"https://api.github.com/users/satyam1812/events{/privacy}","received_events_url":"https://api.github.com/users/satyam1812/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/satyam1812/todo","description":null,"fork":false,"url":"https://api.github.com/repos/satyam1812/todo","forks_url":"https://api.github.com/repos/satyam1812/todo/forks","keys_url":"https://api.github.com/repos/satyam1812/todo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/satyam1812/todo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/satyam1812/todo/teams","hooks_url":"https://api.github.com/repos/satyam1812/todo/hooks","issue_events_url":"https://api.github.com/repos/satyam1812/todo/issues/events{/number}","events_url":"https://api.github.com/repos/satyam1812/todo/events","assignees_url":"https://api.github.com/repos/satyam1812/todo/assignees{/user}","branches_url":"https://api.github.com/repos/satyam1812/todo/branches{/branch}","tags_url":"https://api.github.com/repos/satyam1812/todo/tags","blobs_url":"https://api.github.com/repos/satyam1812/todo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/satyam1812/todo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/satyam1812/todo/git/refs{/sha}","trees_url":"https://api.github.com/repos/satyam1812/todo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/satyam1812/todo/statuses/{sha}","languages_url":"https://api.github.com/repos/satyam1812/todo/languages","stargazers_url":"https://api.github.com/repos/satyam1812/todo/stargazers","contributors_url":"https://api.github.com/repos/satyam1812/todo/contributors","subscribers_url":"https://api.github.com/repos/satyam1812/todo/subscribers","subscription_url":"https://api.github.com/repos/satyam1812/todo/subscription","commits_url":"https://api.github.com/repos/satyam1812/todo/commits{/sha}","git_commits_url":"https://api.github.com/repos/satyam1812/todo/git/commits{/sha}","comments_url":"https://api.github.com/repos/satyam1812/todo/comments{/number}","issue_comment_url":"https://api.github.com/repos/satyam1812/todo/issues/comments{/number}","contents_url":"https://api.github.com/repos/satyam1812/todo/contents/{+path}","compare_url":"https://api.github.com/repos/satyam1812/todo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/satyam1812/todo/merges","archive_url":"https://api.github.com/repos/satyam1812/todo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/satyam1812/todo/downloads","issues_url":"https://api.github.com/repos/satyam1812/todo/issues{/number}","pulls_url":"https://api.github.com/repos/satyam1812/todo/pulls{/number}","milestones_url":"https://api.github.com/repos/satyam1812/todo/milestones{/number}","notifications_url":"https://api.github.com/repos/satyam1812/todo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/satyam1812/todo/labels{/name}","releases_url":"https://api.github.com/repos/satyam1812/todo/releases{/id}","deployments_url":"https://api.github.com/repos/satyam1812/todo/deployments","created_at":"2018-02-07T10:20:31Z","updated_at":"2018-02-07T10:20:31Z","pushed_at":"2018-02-07T11:04:49Z","git_url":"git://github.com/satyam1812/todo.git","ssh_url":"git@github.com:satyam1812/todo.git","clone_url":"https://github.com/satyam1812/todo.git","svn_url":"https://github.com/satyam1812/todo","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/1"},"html":{"href":"https://github.com/satyam1812/todo/pull/1"},"issue":{"href":"https://api.github.com/repos/satyam1812/todo/issues/1"},"comments":{"href":"https://api.github.com/repos/satyam1812/todo/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/satyam1812/todo/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/satyam1812/todo/statuses/3d3c51448a5f5b9fefdda3ee87de7aaf06f32eee"}},"author_association":"OWNER"}}
{"actor":{"display_login":"shekhartyagi26"}}