Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
app.get("/api/loggedin.json", [
function(req, res, next) {
if (!req.user) return next(new Error("not logged in"));
return next();
},
function(req, res, next) {
return req.json({
"loggedin": true
});
},
function(err, req, res, next) {
return req.json({
"loggedin": false
});
},
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.