One route idea
A good route describes a resource. The HTTP method describes the action.
Use /projects with GET to list projects. Use /projects with POST to create one. Avoid routes like /getProjects or /createProject.
Routes are contracts
Your API routes are the first thing a recruiter will scan. They should be easy to guess without reading every line of code.
Think like a frontend developer using your API. If the app has students, projects, teams, or applications, those words usually become route names.
Pick route names
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Clean route sketch
This is a simple project API shape. It uses route methods from HTTP methods such as GET, POST, PATCH, and DELETE.
Express route paths do not include query strings. /projects?tech=node is still matched by /projects.
import express from 'express';
const app = express();
app.get('/projects', (req, res) => {
res.json({ message: 'List projects' });
});
app.post('/projects', (req, res) => {
res.status(201).json({ message: 'Create project' });
});
app.get('/projects/:id', (req, res) => {
res.json({ message: `Get project ${req.params.id}` });
});
app.patch('/projects/:id', (req, res) => {
res.json({ message: `Update project ${req.params.id}` });
});
app.delete('/projects/:id', (req, res) => {
res.status(204).send();
});Avoid action URLs
Beginners often put the verb inside the path. That makes the API noisy and hard to extend.
Do not write /getAllProjects, /addProject, /deleteProject/:id. The method already says the action.
Use AI carefully
Ask ChatGPT, Gemini, or Claude to review your route plan before coding. Paste your app idea and ask for REST-style routes using nouns and HTTP methods.
Check the output. Remove action names in paths. Keep query strings separate from route paths. Do not accept old Express 4 wildcard examples like /* for Express 5.
Prompt:
I am building an Express 5 API for a college hackathon project tracker.
Suggest a simple route table using resource nouns, HTTP methods, and short descriptions.
Do not use action words like getProject in the URL.
Keep filters as query strings.Route table first
Before writing code, make a small route table in your README or notes. This keeps your API consistent when you add middleware, body handling, and errors later.
GET /projects List projects
POST /projects Create a project
GET /projects/:id Get one project
PATCH /projects/:id Update one project
DELETE /projects/:id Delete one project
GET /projects?tech=node Filter projects by techDo this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done