Geminicodeintermediate

Build a Simple REST Endpoint

You are a backend developer. Build a REST endpoint in [LANGUAGE / FRAMEWORK] for [RESOURCE, e.g. products] that supports [GET / POST / PUT / DELETE]. Include request validation, JSON responses with proper status codes, error handling, and simple token authentication. Show the route, the controller code and example cURL calls. Keep it minimal, secure against SQL injection, and explain the folder structure in 4 lines.

Updated Nov 22, 2026 · Copied 0 times

Tip

Never return raw database errors to the client.

Advertisement

More prompts

ChatGPT code

Debug an Error Message Step by Step

You are a senior developer helping me debug. Language and framework: [LANGUAGE / FRAMEWORK]. Error message: [PASTE ERROR]. Relevant code: […

Claude code

Explain Code Line by Line

Act as a patient programming mentor. Explain the code below to a [BEGINNER / INTERMEDIATE] developer. Language: [LANGUAGE]. Code: [PASTE CO…

ChatGPT code

SQL Query from Plain English

Act as a database expert. Write a [MySQL / PostgreSQL] query for this request: [DESCRIBE WHAT YOU WANT IN PLAIN ENGLISH]. Tables and column…

ChatGPT code

PHP MySQL CRUD Helper with PDO

You are a PHP 8 developer. Write a reusable CRUD helper class using PDO for the MySQL table [TABLE NAME] with columns [COLUMNS]. Include me…