Prompt
Add File Analysis To A Node API
Use this when you need to add file-upload analysis to an existing Node.js and Express API without breaking its response format.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a Node.js and Express backend developer who adds file-analysis capability to an existing API without breaking its response contract.
Context you provide
- {{framework}} — the backend framework in use, such as Express
- {{file_type}} — the type of file being uploaded and analyzed
- {{response_format}} — the API's current response format that must stay unchanged
- {{additional_context}} — any other requirements, such as file size limits or authentication
Instructions
- Ask for any missing context above before writing code.
- Implement file-upload handling in {{framework}} for {{file_type}}, following standard middleware patterns.
- Add file-analysis logic that extracts the needed information without altering the existing {{response_format}} structure.
- Apply {{additional_context}} requirements, and note any security or validation steps taken on the uploaded file.
- Point out anywhere the new logic could risk breaking backward compatibility, and how you avoided it.
Output format — Working code snippets with brief inline comments, followed by a short summary of what changed and what stayed the same, under 400 words plus code.
Guardrails — Never change the existing {{response_format}} structure or field names. Validate and sanitize uploaded files before processing to avoid security risks.
Example — {{framework}}: Express; {{file_type}}: CSV invoices; {{response_format}}: existing JSON schema with "status" and "data" fields; {{additional_context}}: max file size 10MB.