{"library":"osprey-middleware","title":"Express Middleware for Osprey RAML APIs","description":"Osprey-middleware is an Express.js middleware designed to integrate the Osprey RAML-based API framework directly into Express applications. Its primary function is to enable request and response validation, routing, and other API governance features as defined by a RAML specification, by exposing the Osprey API definition as an Express router. The package currently stands at version 0.5.0, indicating it never reached a stable 1.0 release. Given the lack of recent updates to this specific package (last commit ~4 years ago as of April 2026) and the core 'osprey' framework (last npm publish July 2020), its release cadence is effectively stalled. This package differentiates itself by its tight integration with the RAML API description language, promoting a documentation-first approach for Node.js Express applications, but its abandonment means it is not actively maintained or developed.","language":"javascript","status":"abandoned","last_verified":"Thu Apr 23","install":{"commands":["npm install osprey-middleware"],"cli":null},"imports":["const ospreyMiddleware = require('osprey-middleware');","express.Router().use(ospreyMiddleware(ramlPath, options));"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const express = require('express');\nconst osprey = require('osprey');\nconst ospreyMiddleware = require('osprey-middleware');\nconst path = require('path');\nconst app = express();\n\nconst ramlPath = path.join(__dirname, 'api.raml'); // Path to your RAML definition file\n\n// A simplified RAML file content for demonstration\n// In a real scenario, this would be a physical file.\nconst dummyRamlContent = `#%RAML 1.0\ntitle: My API\nversion: v1\nbaseUri: /api\n/users:\n  get:\n    responses:\n      200:\n        body:\n          application/json:\n            example: { \"users\": [ { \"id\": 1, \"name\": \"Test User\" } ] }`;\n\n// In a real application, you'd load from 'ramlPath'\n// For this example, we'll directly use 'osprey.create' with dummy content\n// Assuming osprey.create is available and handles string input or a mock file system\n\nosprey.create(dummyRamlContent, { server: { notFoundHandler: false } })\n  .then(apiMiddleware => {\n    // ospreyMiddleware wraps the apiMiddleware generated by osprey\n    app.use('/v1', ospreyMiddleware(apiMiddleware));\n\n    app.listen(3000, () => {\n      console.log('Server running on http://localhost:3000');\n      console.log('Try accessing http://localhost:3000/v1/users (GET)');\n    });\n  })\n  .catch(err => {\n    console.error('Failed to load RAML or start Osprey:', err);\n    process.exit(1); \n  });","lang":"javascript","description":"This quickstart initializes an Express application and integrates osprey-middleware using a dummy RAML definition, setting up a basic API endpoint.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}