title: REST endpoints with Sails.js scaffolding
body: <p>I am new to node and new to sails. So this question may be pretty stupid, but I have used the "sails generate prospects" command to generate a REST api. I can access that api by visiting /api/v1/prospects (i set up the prefix).</p>
  
  <p>I used chrome's postman extension to POST the following json array to that api, and it worked perfectly:</p>
  
  <pre><code>{
              "contactInfo" : {
                  "firstName" : "john",
                  "lastName" : "Stamos",
                  "company" : "Full House",
                  "title" : "Owner", 
                  "phone" : "(352) 555-5555",
                  "email" : "ken@contact.com",
                  "website" : "http://fullhouse.com",
                  "facebookUrl" : "http://facebook.com/fullhouse",
                  "twitterUrl" : "http://twitter.com/fullhouse",
                  "linkedInUrl" : "http://linkedin.com/fullhouse",
                  "backgroundInfo" : "Ken and I first got together when Cynthia needed a web designer!",
                  "firstContact" : "2014-07-09T12:00:00Z"
              },
              "address" : {
                  "address" : "1234 Somewhere Street",
                  "address2" : "Suite 1",
                  "city" : "Ocala",
                  "state" : "FL",
                  "zipcode" : "35675"
              },
              "files" : [
                  {
                      "filename" : "2345456324-23445745.jpg",
                      "folder" : "some folders name",
                      "insDate" : "2014-07-09T12:00:00Z"
                  },
                  {
                      "filename" : "2345332423-3453565462.jpg",
                      "folder" : "some folders name",
                      "insDate" : "2014-07-09T12:00:00Z"
                  }
              ],
              "notes" : [
                  {
                      "note" : "She emailed me friday about a new project",
                      "teamMemberId" : 0,
                      "insDate" : "2014-07-09T12:00:00Z"
                  },
                  {
                      "note" : "Just talked to her about a proposal.",
                      "teamMemberId" : 0,
                      "insDate" : "2014-07-13T12:00:00Z"
                  }
              ],
              "access" : [],
              "blockAccess" : [1],
              "ownerId" : 0
          }
  </code></pre>
  
  <p>Here's my question... I was using firebase earlier, and while I know that Firebase is probably a hell of a complicated program and they worked months to get it to work, I love how they have REST endpoints set up within a record. Is this possible out of the box with sails.js?</p>
  
  <p>By that i mean, assuming i imported this same exact json array into firebase, i could query the endpoint:</p>
  
  <p>api/v1/prospects/1/address and I would get back:</p>
  
  <pre><code>{
                      "address" : "1234 Somewhere Street",
                      "address2" : "Suite 1",
                      "city" : "Ocala",
                      "state" : "FL",
                      "zipcode" : "35675"
                  }
  </code></pre>
  
  <p>or if I queried api/v1/prospects/1/files, I would get back: </p>
  
  <pre><code>[
                      {
                          "filename" : "2345456324-23445745.jpg",
                          "folder" : "some folders name",
                          "insDate" : "2014-07-09T12:00:00Z"
                      },
                      {
                          "filename" : "2345332423-3453565462.jpg",
                          "folder" : "some folders name",
                          "insDate" : "2014-07-09T12:00:00Z"
                      }
                  ]
  </code></pre>
  
  <p>Does anyone have any suggestions how I could put together this kind of an API with sails.js or express.js? I want to avoid using firebase for my api, but its looking really tempting unless I can get something like this working. Any tutorials, videos, resources etc where exactly this API scheme are created would be wonderful.</p>
  
  <p>Thanks!</p>