1

I'm not getting odata-server working on my machine (Windows 8.1, nodejs 0.10.30, mongo 2.4.8). Also tried clean Ubuntu install, same problem. Repro scenario:

  • create directory
  • npm install odata-server
  • cd node_modules/odata-server
  • node newsreader.js

This gives the following output:

Should be empty: []
Test data upload successful. 100 items inserted.
Starting NewsReader OData server.

C:\Projects\odata\node_modules\odata-server\node_modules\mongodb\lib\mongodb\connection\base.js:245
throw message;
^
TypeError: Object function createServer() {
function app(req, res, next){ app.handle(req, res, next); }
merge(app, proto);
merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
return app;
} has no method 'basicAuth'
at C:\Projects\odata\node_modules\odata-server\newsreader.js:14:25
at defer.<anonymous> (C:\Projects\odata\node_modules\odata-server\newsreader\context.js:123:13)
at Object.cbWrapper.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\JayDataModules\qDeferred.js:25:38)
at NewsContext.$data.Class.define._applyTransaction (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:224:16)
at readyFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1430:17)
at NewsContext.$data.Class.define._postProcessSavedItems (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1473:14)
at Object.innerCallback.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\EntityContext.js:1154:29)
at Object.self._saveCollections.success (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:653:38)
at readyFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:566:22)
at esFn (C:\Projects\odata\node_modules\odata-server\node_modules\jaydata\lib\Types\StorageProviders\mongoDB\mongoDBStorageProvider.js:590:19)

what am I missing?

Patrick
  • 13
  • 3

1 Answers1

2

Connect no longer ships with basicAuth (along with the rest of the middleware) and has been moved to an external middleware repo.

This can be found here.

Ben Fortune
  • 31,623
  • 10
  • 79
  • 80
  • Thanks! So how should this problem be solved? Is this something I can fix myself or should this be fixed in the odata-server package? – Patrick Aug 18 '14 at 15:25
  • It should be fixed in the package, though you can manually install older versions of connect that had middleware bundled in, or just edit the package and submit a pull request. – Ben Fortune Aug 18 '14 at 15:26