Setting up a new Yeoman project using the sp2010 rest emulator:
- Create a new Yeoman project, eg:
$ yo webapp my-project
. - Install the SharePoint 2010 rest emulator
$ npm install sp2010-rest --save-dev
. - Add the rest emulator as middleware to any connect servers in your project's Gruntfile.js.
- Create a 'lists' folder in your project, and fill it with a copy of the json REST response (eg:
/_vti_bin/listdata.svc/Documents
-> demo-list.json) for any SharePoint lists you would like to emulate.
Deploying a Yeoman project to a sp2010 server:
- Map a network drive to SharePoint.
- Add a new grunt-contrib-copy task to your project's Gruntfile.js which points to a folder (for mac:
/Volumes/server/subdomain/SitePages/my-project
) in SharePoint. - Build the project as usual
$ grunt build
. - Create an index.aspx to host the contents of your index.html (either with an iframe or by copy/pasting the appropriate html).