{"plugin":{"id":12,"name":"use-api","icon":"📨","description":"FileSystem based API","longDescription":"### Plugin for Creating File-System Based API Routes\n#### Overview\nThe plugin utilizes the `\"use-api\"` directive to create API routes based on the file-system structure, similar to Next.js. This approach simplifies the development process by automatically generating routes from the folder and file organization.\n\n#### Key Features\n* **File-System Routing**: API endpoints are created based on the directory structure, making it intuitive to manage and expand the API.\n* **Directive-Based**: Only files containing the `\"use-api\"` directive are recognized as API routes, ensuring that other files are not mistakenly included.\n* **Hot Reload**: In development mode, routes are automatically reloaded, streamlining the testing and iteration process.\n* **Build Safety**: The plugin prevents API routes from being included in browser builds, enhancing security and performance.\n* **All HTTP Methods**: Supports a wide range of HTTP methods, including GET, POST, PUT, DELETE, PATCH, OPTIONS, and HEAD, catering to diverse API requirements.\n\n#### Example Use Case\nTo create an API route using this plugin, simply add the `\"use-api\"` directive at the top of your file. For instance, a file named `users.js or users.ts` with the directive would automatically generate a route based on its location in the file system.\n","version":"0.1.0","compatibleVersions":"^3.0.0","author":"Justin Halle","ownerId":"c166cdde-5f5c-40e5-a3ff-236652fa88a9","category":"api","tags":["api","filesystem","self-host"],"published":true,"npmPackage":"frame-master-plugin-use-api","githubUrl":"https://github.com/shpaw415/frame-master-plugin-use-api","docsUrl":null,"installation":"bun add frame-master-plugin-use-api","quickStart":"// api/v1/exemple.ts\n\"use-api\";\nexport async function GET(master: masterRequest) {\n  master.setResponse(\"Hello from GET /api/v1/exemple\");\n}\nexport async function POST(master: masterRequest) {\n  master.setResponse(\"Hello from POST /api/v1/exemple\");\n}","configuration":"import type { FrameMasterConfig } from \"frame-master/server/types\";\nimport UseApi from \"frame-master-plugin-use-api\";\n\nexport default {\n  HTTPServer: {\n    port: 3001,\n  },\n  plugins: [UseApi({ basePath: \"api\" })],\n} satisfies FrameMasterConfig;","upvote":0,"downvote":0,"createdAt":"2025-12-12T00:19:37.000Z","updatedAt":"2025-12-12T00:19:37.000Z","dependencies":[]}}