Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.use('/*', function(req, res, next) {
- if (req.subdomains.length >= 1) {
- myDB.User.find({where: { subdomain: req.subdomains[0] }}).success(function(result) {
- req.user = result; // assuming we found one, you get the idea
- next();
- });
- } else {
- next(); // we don't have a user object, no need to attach it
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement