{"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/express/issues/2675","labels_url":"https://api.github.com/repos/strongloop/express/issues/2675/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/express/issues/2675/comments","events_url":"https://api.github.com/repos/strongloop/express/issues/2675/events","html_url":"https://github.com/strongloop/express/issues/2675","id":87576074,"number":2675,"title":"express-handlebars layouts not using \"views\" setting?","user":{"login":"dnutels","id":1825272,"avatar_url":"https://avatars.githubusercontent.com/u/1825272?v=3","gravatar_id":"","url":"https://api.github.com/users/dnutels","html_url":"https://github.com/dnutels","followers_url":"https://api.github.com/users/dnutels/followers","following_url":"https://api.github.com/users/dnutels/following{/other_user}","gists_url":"https://api.github.com/users/dnutels/gists{/gist_id}","starred_url":"https://api.github.com/users/dnutels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnutels/subscriptions","organizations_url":"https://api.github.com/users/dnutels/orgs","repos_url":"https://api.github.com/users/dnutels/repos","events_url":"https://api.github.com/users/dnutels/events{/privacy}","received_events_url":"https://api.github.com/users/dnutels/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/express/labels/4.x","name":"4.x","color":"ededed"},{"url":"https://api.github.com/repos/strongloop/express/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-06-12T02:15:29Z","updated_at":"2015-06-12T02:57:26Z","closed_at":"2015-06-12T02:57:26Z","body":"Hi.\r\n\r\nI am a bit puzzled by this, as there are no reports, yet my various attempts came up with nothing.\r\n\r\nAnyway - trying to relocate the `views` folder doesn't work.\r\n\r\nThis code (in `server.js` file in the root of the project):\r\n\r\n```\r\nvar express = require('express');\r\nvar expressHbs = require('express-handlebars');\r\n\r\nvar app = express();\r\n\r\napp.set('views', __dirname + '/views1');\r\napp.engine('hbs', expressHbs({extname:'hbs', defaultLayout:'main.hbs'}));\r\napp.set('view engine', 'hbs');\r\n\r\napp.get('/', function(req, res){\r\n  res.render('index');\r\n});\r\n\r\napp.listen(8080);\r\n```\r\n\r\nwhere `views1` is (and it is in the root folder, the same with the `server.js` above):\r\n\r\n```\r\nviews1                         \r\n└───layouts     \r\n│        └───main.hbs\r\n└───index.hbs   \r\n```\r\n\r\nproduces this (abridged):\r\n\r\n```\r\nError: ENOENT, open '<path-to-root-folder>/views/layouts/main.hbs'\r\n```\r\n\r\n__Renaming the folder to `views` and removing `app.set('views', ...);` line makes this work properly.__\r\n\r\nI must be missing something, as this is too basic a functionality to not work.\r\n\r\nP.S. \r\n\r\nThere were additional attempts revolving around using something like this instead (to make sure that the path is resolved properly and whatnot):\r\n\r\n```\r\napp.set('views', path.resolve(__dirname, 'views1'));\r\n```\r\nto no avail.\r\n"}}