Skip to content

Instantly share code, notes, and snippets.

@mikekunze
Created July 26, 2012 23:04
Show Gist options
  • Save mikekunze/3185143 to your computer and use it in GitHub Desktop.
Save mikekunze/3185143 to your computer and use it in GitHub Desktop.
reportGenerator route for accessing a sharepoint 2010 list and spitting the data out with HTML
require 'coffee-script'
request = require 'request'
data =
getData: (cb)->
username = 'someUser'
password = 'somePassword'
proto = 'https://'
site = 'sharepoint.domain.com/_vti_bin/listdata.svc'
config =
url: proto + username + ':' + password + '@' + site + '/' + 'someList?$orderby=someColumn'
json: true
request config, (err, res, body)->
if err
console.log err
cb body.d.results
routes =
index: (req, res)->
data.getData (dataArray)->
options =
title: 'reportGenerator'
layout: 'layout.jade'
items: dataArray
res.render 'index', options
module.exports = routes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment