Agreed Server is a mock server for the Agreed API specification format, providing CLI and programmable interfaces for creating mock APIs from agreed files. Version 3.0.1 is the latest stable release. It supports custom middlewares, default headers, static file serving, and a notifier for real-time event handling. Unlike generic mock servers, it is tightly integrated with the Agreed ecosystem and offers an Express-based pure server mode for advanced customization.
npm install agreed-serverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Starts a basic mock server from an agreed file on port 3001 using the CLI-compatible API.
Continue using require('agreed-server') for default import. For ESM, use dynamic import or bundler.Use middlewares array with express.static() instead of static option.
Attach notifier.on('message', ...) before starting the server to avoid missing events.Provide an absolute path or ensure relative path is correct from working directory.
Call .createServer() on the returned object, or use the CLI directly.
Use const agreedServer = require('agreed-server');Ensure the agreed file exists and use correct path (absolute or relative to process.cwd()).
Upgrade to v3 or use the older API: const server = agreedServer(options); server.listen();