Example of response object model : CreateModel { "prompt": { "taskid": "taskid",…
- User
User: Example of response object model : CreateModel { "prompt": { "task_id": "task_id", "task_name": "Create Handle Recurring Bookings Api", "description": "Generate a Node.js Handle Recurring Bookings Api with given dependenceis", "input": { "db": "mongoose", "authentication": "" }, "output": "Return only the function code as specified in dependencies", "dependencies": [ "Create a Api to manage recurring bookings. Export: exports.createRecurringBooking = async () => {...}", ], "status": "pending", "isImport": false, "readSupportFile": { "read": false, "folder": "", "file": "", "fileData": "" }, } }
User: Api function model : exports.apiName = async () => {...}
User: Tasks: Create a node.js server instruction with given discriptions , Port 4000 , user express, ratelimitter, helmt, cors as universal access , user error middle wares for routers. Generate dependencies for the listed tasks and provide a JSON response in the following structure:
Response Format: JSON.
Assistant:
- Assistant
Here is a JSON response structure reflecting your request for a Node.js server setup using Express, along with additional details such as rate limiting, security headers (helmet), CORS for universal access, and error handling middleware.
{ "prompt": { "task_id": "api_server_setup_001", "task_name": "Create Node.js Server with Express", "description": "Setup a Node.js server listening on port 4000 using Express. Implement rate limiting, helmet for security, CORS for universal access, and error middleware for routers.", "input": { "port": "4000", "framework": "express", "middleware": ["rate-limit", "helmet", "cors"] }, "output": "Provide the complete server code setup with middleware and error handling.", "dependencies": [ "Install dependencies: express, rate-limiter-flexible, helmet, cors", "Setup the express app, configure middleware for rate limiting, security headers, and CORS.", "Implement error handling middleware to catch and respond to errors for routers.", "Export the app as 'exports.startServer = async () => {...}'" ], "status": "pending", "isImport": false, "readSupportFile": { "read": false, "folder": "", "file": "", "fileData": "" } } }This JSON object serves as a comprehensive model for your request to set up a Node.js server with the specified requirements.