{"action":"opened","issue":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/5145","labels_url":"https://api.github.com/repos/TryGhost/Ghost/issues/5145/labels{/name}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/5145/comments","events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/5145/events","html_url":"https://github.com/TryGhost/Ghost/issues/5145","id":68488668,"number":5145,"title":"Allow to set Ghost configuration in main script, when using npm module","user":{"login":"pensierinmusica","id":3594037,"avatar_url":"https://avatars.githubusercontent.com/u/3594037?v=3","gravatar_id":"","url":"https://api.github.com/users/pensierinmusica","html_url":"https://github.com/pensierinmusica","followers_url":"https://api.github.com/users/pensierinmusica/followers","following_url":"https://api.github.com/users/pensierinmusica/following{/other_user}","gists_url":"https://api.github.com/users/pensierinmusica/gists{/gist_id}","starred_url":"https://api.github.com/users/pensierinmusica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pensierinmusica/subscriptions","organizations_url":"https://api.github.com/users/pensierinmusica/orgs","repos_url":"https://api.github.com/users/pensierinmusica/repos","events_url":"https://api.github.com/users/pensierinmusica/events{/privacy}","received_events_url":"https://api.github.com/users/pensierinmusica/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-14T20:28:13Z","updated_at":"2015-04-14T20:28:13Z","closed_at":null,"body":"Hi,\r\n\r\nI'm using Ghost as an npm module to run different blogs on the same server. Each blog has its own script. I think it's unconvenient though to be forced to have the configuration in a separate file.\r\n\r\nI would like to be able to have this code:\r\n\r\n```javascript\r\nvar ghost = require('ghost');\r\nvar path = require('path');\r\n\r\n// Configuration parameters\r\nvar conf = {\r\n  production: {\r\n    url: 'http://myblog.com', // Blog url\r\n    server: {\r\n      host: '127.0.0.1', // Port that the server instance will be listening to\r\n      port: '3000'\r\n    },\r\n    database: {\r\n      client: 'sqlite3',\r\n      connection: {\r\n        filename: path.join(__dirname, '/content/data/ghost.db') // Database storage path\r\n      },\r\n      debug: false\r\n    },\r\n    paths: {\r\n      contentPath: path.join(__dirname, '/content/') // Content storage path\r\n    }\r\n  }\r\n};\r\n\r\n// Start Ghost server\r\nghost({config: conf}).then(function (ghostServer) {\r\n  ghostServer.start();\r\n});\r\n```\r\n\r\nIf I do it this way though I get this error: `Possibly unhandled TypeError: path must be a string`, which I think originates from the fact that the `config` property of the object passed to `ghost()` needs to be a string representing a path to the config file. Why not allowing though to directly pass the config object itself? Having both options would be the best imho.\r\n\r\nEven better I'd like this API:\r\n\r\n```javascript\r\n// Start Ghost server\r\nghost(conf).then(function (ghostServer) {\r\n  ghostServer.start();\r\n});\r\n```\r\n\r\nWhere `conf` is the object defined in the first example.\r\n\r\nAny chance this could be changed to avoid being forced to create multiple files when it's not needed?\r\n\r\nThanks for putting together this awesome project!"}}