sahat / instagram-hackhands Goto Github PK
View Code? Open in Web Editor NEWSource code for HackHands blog post
Home Page: https://hackhands.com/building-instagram-clone-angularjs-satellizer-nodejs-mongodb/
License: MIT License
Source code for HackHands blog post
Home Page: https://hackhands.com/building-instagram-clone-angularjs-satellizer-nodejs-mongodb/
License: MIT License
Can you point me to any examples using server side or Code Flow?
This repo is awesome + the blog post is a great resource. I think it would be nice to remove the /vendor
directory in favor of bower - so other could learn those best practices.
Sa
I wasn't able to get the client running on the browser. I assumed that gulp
would open in (similar to grunt serve
). What am I missing?
Hello All,
I would like to run this demo, but I do not know what versions of node.js I should be using and have installed a docker container running mongodb.
Any ideas?
Thanks,
It should be
app.use(express.static(path.join(__dirname, './../client'), { maxAge: 2628000000 }));
Instagram was deprecated /users/self/feed.
View changelog of Nov 17, 2015.
https://www.instagram.com/developer/changelog/
This issue can be resolved consuming other instagram endpoint:
`app.get('/api/feed', isAuthenticated, function(req, res) {
var feedUrl = 'https://api.instagram.com/v1/users/self/media/recent/';
var params = { access_token: req.user.accessToken,
count : 5 };
request.get({ url: feedUrl, qs: params, json: true }, function(error, response, body) {
if (!error && response.statusCode == 200) {
res.send(body.data);
}
});
});`
Thank you.
tl;dr: Email/password signup with automatic login doesn't save a currentUser
value and causes an error on page refresh. Can be fixed with slight change to SignupCtrl
.
I used this repository and the associated tutorial to implement an email/password signup system, but noticed a problem that can be recreated as follows:
$window.localStorage
on the call to its local.signup
function (via the call to $auth.signup
), but does not create a currentUser
value in either localStorage
or the $rootScope
;run
block in app.js
confirms that there is an unexpired JWT saved to localStorage
and attempts to access the property $window.localStorage.currentUser
, which has never been set and is therefore undefined
;run
block calls JSON.parse
on the undefined
property, which causes an Uncaught SyntaxError: Unexpected token u
.This issue can be fixed by slightly changing SignupCtrl
to more-closely match the pattern used in LoginCtrl
. The current signup function is:
$scope.signup = function() {
var user = {
email: $scope.email,
password: $scope.password
};
$auth.signup(user)
.catch(function(response) {
console.log(response.data);
});
};
Adding a then
block after the call to $auth.signup
solves the problem:
$scope.signup = function() {
var user = {
email: $scope.email,
password: $scope.password
};
$auth.signup(user)
.then(function(response) {
$window.localStorage.currentUser = JSON.stringify(response.data.user);
$rootScope.currentUser = JSON.parse($window.localStorage.currentUser);
})
.catch(function(response) {
console.log(response.data);
});
};
This way, as soon as a user is successfully signed up the value of currentUser
is stored in both $window.localStorage
and the $rootScope
.
Hi,
When retrieving an image in response to such a variable: photo.user_has_like
.
Perhaps this could be used if you already have the image liked.
Refresh page when the hasLiked
variable is not updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.