{"action":"created","issue":{"url":"https://api.github.com/repos/uniquejava/blog/issues/89","repository_url":"https://api.github.com/repos/uniquejava/blog","labels_url":"https://api.github.com/repos/uniquejava/blog/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/uniquejava/blog/issues/89/comments","events_url":"https://api.github.com/repos/uniquejava/blog/issues/89/events","html_url":"https://github.com/uniquejava/blog/issues/89","id":223535278,"number":89,"title":"前后端分离实战","user":{"login":"uniquejava","id":1049271,"avatar_url":"https://avatars2.githubusercontent.com/u/1049271?v=3","gravatar_id":"","url":"https://api.github.com/users/uniquejava","html_url":"https://github.com/uniquejava","followers_url":"https://api.github.com/users/uniquejava/followers","following_url":"https://api.github.com/users/uniquejava/following{/other_user}","gists_url":"https://api.github.com/users/uniquejava/gists{/gist_id}","starred_url":"https://api.github.com/users/uniquejava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uniquejava/subscriptions","organizations_url":"https://api.github.com/users/uniquejava/orgs","repos_url":"https://api.github.com/users/uniquejava/repos","events_url":"https://api.github.com/users/uniquejava/events{/privacy}","received_events_url":"https://api.github.com/users/uniquejava/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-22T02:50:59Z","updated_at":"2017-04-25T16:10:13Z","closed_at":null,"body":"[也谈基于NodeJS的全栈式开发（基于NodeJS的前后端分离）](http://blog.jobbole.com/65513/)\r\n[前后端分离项目实践分析](https://cnodejs.org/topic/55b9d2b3f36f579657fc52c8)"},"comment":{"url":"https://api.github.com/repos/uniquejava/blog/issues/comments/297081400","html_url":"https://github.com/uniquejava/blog/issues/89#issuecomment-297081400","issue_url":"https://api.github.com/repos/uniquejava/blog/issues/89","id":297081400,"user":{"login":"uniquejava","id":1049271,"avatar_url":"https://avatars2.githubusercontent.com/u/1049271?v=3","gravatar_id":"","url":"https://api.github.com/users/uniquejava","html_url":"https://github.com/uniquejava","followers_url":"https://api.github.com/users/uniquejava/followers","following_url":"https://api.github.com/users/uniquejava/following{/other_user}","gists_url":"https://api.github.com/users/uniquejava/gists{/gist_id}","starred_url":"https://api.github.com/users/uniquejava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uniquejava/subscriptions","organizations_url":"https://api.github.com/users/uniquejava/orgs","repos_url":"https://api.github.com/users/uniquejava/repos","events_url":"https://api.github.com/users/uniquejava/events{/privacy}","received_events_url":"https://api.github.com/users/uniquejava/received_events","type":"User","site_admin":false},"created_at":"2017-04-25T16:10:13Z","updated_at":"2017-04-25T16:10:13Z","body":"### Node调用Java后台\r\n所有的请求都通过node中间层(浏览器不直接调用后台API) \r\n\r\n通过node调用java RESTful API 简单方便, 也不会存在跨域问题, demo代码:\r\n```js\r\nvar request = require('request');\r\nvar appconfig = require('../config');\r\n\r\nvar mobile = 18971991234;\r\n\r\n//发送手机验证码\r\nrequest.get(appconfig.api + '/mobile/authcode?mobile=' + mobile, {json: true}, function (error, response, data) {\r\n    console.log(error);\r\n    console.log(data.msg);\r\n\r\n    var authcode = data.msg.slice(-6);\r\n\r\n    // 注册\r\n    request.post({\r\n        url: appconfig.api + '/user/register',\r\n        form: {\r\n            loginName: 'username1',\r\n            mobile: mobile,\r\n            password: 'secret123',\r\n            authcode: authcode\r\n        },\r\n        json: true\r\n    }, function (error, response, data) {\r\n        console.log(error);\r\n        console.log(data);\r\n    });\r\n});\r\n\r\n\r\n\r\n```\r\n"}}
{"actor":{"display_login":"uniquejava"}}