Tag: 要点

如何通过API发布主旨(不是匿名的)

我正在使用passport-github策略。 passport.use(new Strategy({ clientID: "…", clientSecret: "…", callbackURL: 'http://localhost:3000/login/github/return', scope: 'gist' }, function(accessToken, refreshToken, profile, cb) { return cb(null, profile); })); 然后我发出POST请求 app.get('/profile/post', require('connect-ensure-login').ensureLoggedIn(), function(req, res){ var url = 'https://api.github.com/gists'; axios.post(url, { method: "POST", "description": "POSTING FROM EXPRESS", "public": true, "files": { "file1.txt": { "content": "EXPRESS " } } }) .then(function (response) {…}) .catch(function (error) […]