Complete AI Training

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

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

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

  1. Ask for any missing context above before writing code.
  2. Implement file-upload handling in {{framework}} for {{file_type}}, following standard middleware patterns.
  3. Add file-analysis logic that extracts the needed information without altering the existing {{response_format}} structure.
  4. Apply {{additional_context}} requirements, and note any security or validation steps taken on the uploaded file.
  5. 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.