Simple OData Server (simple-odata-server) is a lightweight Node.js library designed to create OData v2 compatible servers with minimal setup. It currently stands at version 1.2.2. While stable and used in projects like jsreport, the repository explicitly states it is no longer actively maintained by its creators, meaning bug fixes and new features are unlikely to be introduced regularly, if at all. Its primary differentiator is its simplicity and direct support for MongoDB and NeDB databases via separate adapter packages (simple-odata-server-mongodb, simple-odata-server-nedb), making it suitable for projects requiring basic OData functionality without the overhead of more comprehensive, feature-rich OData frameworks. It supports core operations like $metadata, filtering, and CRUD operations, but intentionally omits advanced features such as entity links, batch operations, or Atom feeds to maintain its lean footprint.
npm install simple-odata-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a basic OData server using simple-odata-server with an in-memory NeDB database, defining a simple 'UserType' entity and exposing it via an 'users' entity set. It then initializes the server, binds it to an HTTP port, and provides example OData requests.
Install the appropriate adapter package: `npm install simple-odata-server-mongodb` or `npm install simple-odata-server-nedb`.
Update your hook implementations to include the `req` parameter: `fn(setName, query, req, cb)` for `query` and `remove`, `fn(setName, doc, req, cb)` for `insert`, and `fn(setName, query, update, req, cb)` for `update`.
Evaluate forking the repository if active development or specific new features are required, or consider alternative OData implementations for long-term projects requiring active support.
Upgrade to `simple-odata-server@1.2.2` or later to resolve Node.js deprecation warnings related to the OData parser.
Ensure the necessary adapter package is installed (`npm install simple-odata-server-nedb`) and imported: `const Adapter = require('simple-odata-server-nedb');` then passed to the server: `.adapter(Adapter(...))`.Review the hook signature to ensure it matches `(setName, query, req, cb)` for `query`/`remove`, `(setName, doc, req, cb)` for `insert`, or `(setName, query, update, req, cb)` for `update`, and call `cb(err, result)` appropriately.
Upgrade `simple-odata-server` to version 1.2.2 or later to use the updated `@jsreport/odata-parser` dependency.