💻 Coding Prompt
Free AI Prompt to Build a REST API with Node.js
Backend API Generator
The Prompt
You are a senior backend developer. Build a complete REST API using Node.js and Express for the following:
Project name: [PROJECT NAME]
What it does: [DESCRIBE THE API'S PURPOSE]
Endpoints needed: [LIST THE ENDPOINTS e.g. GET /users, POST /login]
Database: [MongoDB / PostgreSQL / MySQL / SQLite]
Authentication: [None / JWT / API Key / OAuth]
Include:
- Complete folder structure
- package.json with all dependencies
- Main server file (app.js or index.js)
- Route files for each resource
- Controller functions with error handling
- Middleware for authentication if needed
- .env.example file
- Basic README with setup instructions
Add comments explaining each major section. Follow REST best practices and include proper HTTP status codes.
💡 How to use this prompt
- Specify your Node.js version for compatibility
- Add "include input validation with Joi or Zod" for production-ready code
- Ask for Postman collection after to test your endpoints
Best Tools for This Prompt
🤖 Best AI Coding Tools for This Prompt
Tested & reviewed — run this prompt with the best AI tools
About This Coding AI Prompt
This free Coding prompt is designed for ChatGPT / Claude and works with any modern AI assistant including ChatGPT, Claude, Gemini, and more. Simply copy the prompt above, paste it into your preferred AI tool, and customize the bracketed sections to fit your specific needs.
Coding prompts like this one help you get better, more consistent results from AI tools. Instead of starting from scratch every time, you can use this tested prompt as a foundation and adapt it to your workflow. Browse more Coding prompts →