{"action":"created","comment":{"url":"https://api.github.com/repos/jhudson8/smocks/pulls/comments/52251087","id":52251087,"diff_hunk":"@@ -778,17 +778,37 @@ Return the same Variant object for chaining.\n ```\n \n \n-#### respondWithFile(filePath)\n-* ***filePath***: the path to the file to serve out (any route variables can be used in the file path as well)\n+#### respondWithFile(options)\n+* ***options***: options to override the default values. *(These options can also be globally provided in the smocks core options when starting the server, see ([Starting the server](#section/Concepts/Starting%2520the%2520server))*\n+  * ***mockDir***: The base directory where the mocking data exists. \n+    * *default value set to* ```./mocked-data```\n+  * ***fileName***: The file name smocks will search for in the ***mockDir*** directory structure and then set as the response.\n+    * *default value set to* ```response.json```\n+  * ***statusCode***: The status code of the response.\n+    * *Default value set to* ```200```\n+    \n+\n+This method enables you to have your json files in a route similar directory structure as follows. \n \n Remember that using ```./``` will refer to the top level module directory (the directory where ```node_modules``` exists regardless of the location of the file that is referring to a file location with ```./```);\n \n+Example 1\n ```javascript\n     var smocks = require('smocks');\n-    smocks.route({path: '/customer/{id}'}).respondWithFile('./customer-{id}.json')\n+    smocks.route({path: '/customer/{id}'}).respondWithFile()","path":"api.md","position":33,"original_position":33,"commit_id":"3c5d3ce7169073e5e677dde16c7ae3fb46cbcf8c","original_commit_id":"3c5d3ce7169073e5e677dde16c7ae3fb46cbcf8c","user":{"login":"dankle","id":2838874,"avatar_url":"https://avatars.githubusercontent.com/u/2838874?v=3","gravatar_id":"","url":"https://api.github.com/users/dankle","html_url":"https://github.com/dankle","followers_url":"https://api.github.com/users/dankle/followers","following_url":"https://api.github.com/users/dankle/following{/other_user}","gists_url":"https://api.github.com/users/dankle/gists{/gist_id}","starred_url":"https://api.github.com/users/dankle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankle/subscriptions","organizations_url":"https://api.github.com/users/dankle/orgs","repos_url":"https://api.github.com/users/dankle/repos","events_url":"https://api.github.com/users/dankle/events{/privacy}","received_events_url":"https://api.github.com/users/dankle/received_events","type":"User","site_admin":false},"body":"Where should the user specify the multiple optional paths in this case?","created_at":"2016-02-09T00:26:34Z","updated_at":"2016-02-09T00:26:34Z","html_url":"https://github.com/jhudson8/smocks/pull/8#discussion_r52251087","pull_request_url":"https://api.github.com/repos/jhudson8/smocks/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/comments/52251087"},"html":{"href":"https://github.com/jhudson8/smocks/pull/8#discussion_r52251087"},"pull_request":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/jhudson8/smocks/pulls/8","id":58401080,"html_url":"https://github.com/jhudson8/smocks/pull/8","diff_url":"https://github.com/jhudson8/smocks/pull/8.diff","patch_url":"https://github.com/jhudson8/smocks/pull/8.patch","issue_url":"https://api.github.com/repos/jhudson8/smocks/issues/8","number":8,"state":"open","locked":false,"title":"Implemented respondWithFile()","user":{"login":"dankle","id":2838874,"avatar_url":"https://avatars.githubusercontent.com/u/2838874?v=3","gravatar_id":"","url":"https://api.github.com/users/dankle","html_url":"https://github.com/dankle","followers_url":"https://api.github.com/users/dankle/followers","following_url":"https://api.github.com/users/dankle/following{/other_user}","gists_url":"https://api.github.com/users/dankle/gists{/gist_id}","starred_url":"https://api.github.com/users/dankle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankle/subscriptions","organizations_url":"https://api.github.com/users/dankle/orgs","repos_url":"https://api.github.com/users/dankle/repos","events_url":"https://api.github.com/users/dankle/events{/privacy}","received_events_url":"https://api.github.com/users/dankle/received_events","type":"User","site_admin":false},"body":"Ready for review. \r\n\r\nImplemented according to the following requirements:\r\n\r\n- User should be able to just call a default method and the file should be automatically picked based on the api path that is mocked.\r\n- Users should be able to provide a default file name during set up.\r\n- User should be able to provide a default mocked data directory structure.\r\n- User should be able to override the default directory structure and filename when writing mocks.\r\n- Add feature to look for the response file in the absolute path based on variant. If file is not present then look for file a directory up than the variant to allow use of same response file.","created_at":"2016-02-05T08:37:17Z","updated_at":"2016-02-09T00:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jhudson8/smocks/pulls/8/commits","review_comments_url":"https://api.github.com/repos/jhudson8/smocks/pulls/8/comments","review_comment_url":"https://api.github.com/repos/jhudson8/smocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jhudson8/smocks/issues/8/comments","statuses_url":"https://api.github.com/repos/jhudson8/smocks/statuses/3c5d3ce7169073e5e677dde16c7ae3fb46cbcf8c","head":{"label":"dankle:master","ref":"master","sha":"3c5d3ce7169073e5e677dde16c7ae3fb46cbcf8c","user":{"login":"dankle","id":2838874,"avatar_url":"https://avatars.githubusercontent.com/u/2838874?v=3","gravatar_id":"","url":"https://api.github.com/users/dankle","html_url":"https://github.com/dankle","followers_url":"https://api.github.com/users/dankle/followers","following_url":"https://api.github.com/users/dankle/following{/other_user}","gists_url":"https://api.github.com/users/dankle/gists{/gist_id}","starred_url":"https://api.github.com/users/dankle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankle/subscriptions","organizations_url":"https://api.github.com/users/dankle/orgs","repos_url":"https://api.github.com/users/dankle/repos","events_url":"https://api.github.com/users/dankle/events{/privacy}","received_events_url":"https://api.github.com/users/dankle/received_events","type":"User","site_admin":false},"repo":{"id":50692573,"name":"smocks","full_name":"dankle/smocks","owner":{"login":"dankle","id":2838874,"avatar_url":"https://avatars.githubusercontent.com/u/2838874?v=3","gravatar_id":"","url":"https://api.github.com/users/dankle","html_url":"https://github.com/dankle","followers_url":"https://api.github.com/users/dankle/followers","following_url":"https://api.github.com/users/dankle/following{/other_user}","gists_url":"https://api.github.com/users/dankle/gists{/gist_id}","starred_url":"https://api.github.com/users/dankle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankle/subscriptions","organizations_url":"https://api.github.com/users/dankle/orgs","repos_url":"https://api.github.com/users/dankle/repos","events_url":"https://api.github.com/users/dankle/events{/privacy}","received_events_url":"https://api.github.com/users/dankle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dankle/smocks","description":"Stateful mock HTTP server using HAPI","fork":true,"url":"https://api.github.com/repos/dankle/smocks","forks_url":"https://api.github.com/repos/dankle/smocks/forks","keys_url":"https://api.github.com/repos/dankle/smocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dankle/smocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dankle/smocks/teams","hooks_url":"https://api.github.com/repos/dankle/smocks/hooks","issue_events_url":"https://api.github.com/repos/dankle/smocks/issues/events{/number}","events_url":"https://api.github.com/repos/dankle/smocks/events","assignees_url":"https://api.github.com/repos/dankle/smocks/assignees{/user}","branches_url":"https://api.github.com/repos/dankle/smocks/branches{/branch}","tags_url":"https://api.github.com/repos/dankle/smocks/tags","blobs_url":"https://api.github.com/repos/dankle/smocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dankle/smocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dankle/smocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/dankle/smocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dankle/smocks/statuses/{sha}","languages_url":"https://api.github.com/repos/dankle/smocks/languages","stargazers_url":"https://api.github.com/repos/dankle/smocks/stargazers","contributors_url":"https://api.github.com/repos/dankle/smocks/contributors","subscribers_url":"https://api.github.com/repos/dankle/smocks/subscribers","subscription_url":"https://api.github.com/repos/dankle/smocks/subscription","commits_url":"https://api.github.com/repos/dankle/smocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/dankle/smocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/dankle/smocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/dankle/smocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/dankle/smocks/contents/{+path}","compare_url":"https://api.github.com/repos/dankle/smocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dankle/smocks/merges","archive_url":"https://api.github.com/repos/dankle/smocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dankle/smocks/downloads","issues_url":"https://api.github.com/repos/dankle/smocks/issues{/number}","pulls_url":"https://api.github.com/repos/dankle/smocks/pulls{/number}","milestones_url":"https://api.github.com/repos/dankle/smocks/milestones{/number}","notifications_url":"https://api.github.com/repos/dankle/smocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dankle/smocks/labels{/name}","releases_url":"https://api.github.com/repos/dankle/smocks/releases{/id}","deployments_url":"https://api.github.com/repos/dankle/smocks/deployments","created_at":"2016-01-29T21:28:57Z","updated_at":"2016-01-29T21:28:57Z","pushed_at":"2016-02-05T19:31:52Z","git_url":"git://github.com/dankle/smocks.git","ssh_url":"git@github.com:dankle/smocks.git","clone_url":"https://github.com/dankle/smocks.git","svn_url":"https://github.com/dankle/smocks","homepage":null,"size":2271,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jhudson8:master","ref":"master","sha":"c308dabc56cc7061afe3b014ab5b0b2264a98b8a","user":{"login":"jhudson8","id":455645,"avatar_url":"https://avatars.githubusercontent.com/u/455645?v=3","gravatar_id":"","url":"https://api.github.com/users/jhudson8","html_url":"https://github.com/jhudson8","followers_url":"https://api.github.com/users/jhudson8/followers","following_url":"https://api.github.com/users/jhudson8/following{/other_user}","gists_url":"https://api.github.com/users/jhudson8/gists{/gist_id}","starred_url":"https://api.github.com/users/jhudson8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhudson8/subscriptions","organizations_url":"https://api.github.com/users/jhudson8/orgs","repos_url":"https://api.github.com/users/jhudson8/repos","events_url":"https://api.github.com/users/jhudson8/events{/privacy}","received_events_url":"https://api.github.com/users/jhudson8/received_events","type":"User","site_admin":false},"repo":{"id":37146936,"name":"smocks","full_name":"jhudson8/smocks","owner":{"login":"jhudson8","id":455645,"avatar_url":"https://avatars.githubusercontent.com/u/455645?v=3","gravatar_id":"","url":"https://api.github.com/users/jhudson8","html_url":"https://github.com/jhudson8","followers_url":"https://api.github.com/users/jhudson8/followers","following_url":"https://api.github.com/users/jhudson8/following{/other_user}","gists_url":"https://api.github.com/users/jhudson8/gists{/gist_id}","starred_url":"https://api.github.com/users/jhudson8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhudson8/subscriptions","organizations_url":"https://api.github.com/users/jhudson8/orgs","repos_url":"https://api.github.com/users/jhudson8/repos","events_url":"https://api.github.com/users/jhudson8/events{/privacy}","received_events_url":"https://api.github.com/users/jhudson8/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhudson8/smocks","description":"Stateful mock HTTP server using HAPI","fork":false,"url":"https://api.github.com/repos/jhudson8/smocks","forks_url":"https://api.github.com/repos/jhudson8/smocks/forks","keys_url":"https://api.github.com/repos/jhudson8/smocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhudson8/smocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhudson8/smocks/teams","hooks_url":"https://api.github.com/repos/jhudson8/smocks/hooks","issue_events_url":"https://api.github.com/repos/jhudson8/smocks/issues/events{/number}","events_url":"https://api.github.com/repos/jhudson8/smocks/events","assignees_url":"https://api.github.com/repos/jhudson8/smocks/assignees{/user}","branches_url":"https://api.github.com/repos/jhudson8/smocks/branches{/branch}","tags_url":"https://api.github.com/repos/jhudson8/smocks/tags","blobs_url":"https://api.github.com/repos/jhudson8/smocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhudson8/smocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhudson8/smocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhudson8/smocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhudson8/smocks/statuses/{sha}","languages_url":"https://api.github.com/repos/jhudson8/smocks/languages","stargazers_url":"https://api.github.com/repos/jhudson8/smocks/stargazers","contributors_url":"https://api.github.com/repos/jhudson8/smocks/contributors","subscribers_url":"https://api.github.com/repos/jhudson8/smocks/subscribers","subscription_url":"https://api.github.com/repos/jhudson8/smocks/subscription","commits_url":"https://api.github.com/repos/jhudson8/smocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhudson8/smocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhudson8/smocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhudson8/smocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhudson8/smocks/contents/{+path}","compare_url":"https://api.github.com/repos/jhudson8/smocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhudson8/smocks/merges","archive_url":"https://api.github.com/repos/jhudson8/smocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhudson8/smocks/downloads","issues_url":"https://api.github.com/repos/jhudson8/smocks/issues{/number}","pulls_url":"https://api.github.com/repos/jhudson8/smocks/pulls{/number}","milestones_url":"https://api.github.com/repos/jhudson8/smocks/milestones{/number}","notifications_url":"https://api.github.com/repos/jhudson8/smocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhudson8/smocks/labels{/name}","releases_url":"https://api.github.com/repos/jhudson8/smocks/releases{/id}","deployments_url":"https://api.github.com/repos/jhudson8/smocks/deployments","created_at":"2015-06-09T17:23:57Z","updated_at":"2016-01-27T21:35:27Z","pushed_at":"2016-02-05T21:35:38Z","git_url":"git://github.com/jhudson8/smocks.git","ssh_url":"git@github.com:jhudson8/smocks.git","clone_url":"https://github.com/jhudson8/smocks.git","svn_url":"https://github.com/jhudson8/smocks","homepage":null,"size":2283,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/8"},"html":{"href":"https://github.com/jhudson8/smocks/pull/8"},"issue":{"href":"https://api.github.com/repos/jhudson8/smocks/issues/8"},"comments":{"href":"https://api.github.com/repos/jhudson8/smocks/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jhudson8/smocks/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/jhudson8/smocks/statuses/3c5d3ce7169073e5e677dde16c7ae3fb46cbcf8c"}}}}