Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning Building Mobile Application Development in the Cloud
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Building Mobile Application Development in the Cloud
This is the forum to discuss the Wrox book Beginning Building Mobile Application Development in the Cloud by Richard Rodger ; ISBN: 978-1-1180-3469-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Building Mobile Application Development in the Cloud section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 30th, 2012, 07:35 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 errors. Out of date connect code?

I'm doing the instructions for connectserver.js. However, when I run "node connectserver.js" I get the error:

Code:
TypeError: Object function createServer() {
  function app(req, res){ app.handle(req, res); }
  utils.merge(app, proto);
  utils.merge(app, EventEmitter.prototype);
  app.route = '/';
  app.stack = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
} has no method 'router'
If I set up connectserver.js similar to the answer post on this stackoverflow question, it runs correctly. Does the code need to be changed to reflect an updated connect API?
Reply With Quote
  #2 (permalink)  
Old October 24th, 2012, 07:35 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default connect module version

Hi - yes, the router functionality was dropped from the connect module.

You have two options - use the dispatch module instead:
https://github.com/caolan/dispatch

This provides equivalent functionality - see the README for usage details.

Alternatively, you can install an older version of connect, using:

npm install git://github.com/senchalabs/connect.git#1.8.6

the original code should then run unchanged,

thanks for the question!
Richard
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 10 code errors in the book GranDad BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 January 26th, 2007 12:25 AM
Chapter 4 Example Code Errors beckerm13 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 September 28th, 2006 04:40 PM
Chapter 8, Report Scripting, Code errors jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 5 June 23rd, 2004 12:50 PM
Errors in Code; Chapter 14, pages 566-567 ou812 BOOK: Beginning ASP 3.0 10 June 20th, 2004 10:43 AM



All times are GMT -4. The time now is 09:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.