Backend

nodejs-express-server

aj-geddes/useful-ai-prompts · updated Apr 8, 2026

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill nodejs-express-server
summary

Production-ready Express.js servers with routing, middleware, authentication, and database integration.

  • Covers core Express patterns including middleware chains, RESTful routing with CRUD operations, and error handling middleware
  • Supports authentication via JWT, database integration with PostgreSQL and Sequelize, and environment-based configuration
  • Includes best practices for input validation, async/await patterns, rate limiting, and HTTPS in production
  • Reference guides provided f
skill.md

Node.js Express Server

Table of Contents

Overview

Create robust Express.js applications with proper routing, middleware chains, authentication mechanisms, and database integration following industry best practices.

When to Use

  • Building REST APIs with Node.js
  • Implementing server-side request handling
  • Creating middleware chains for cross-cutting concerns
  • Managing authentication and authorization
  • Connecting to databases from Node.js
  • Implementing error handling and logging

Quick Start

Minimal working example:

const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;

// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

// Routes
app.get("/health", (req, res) => {
  res.json({ status: "OK", timestamp: new Date().toISOString() });
});

// Error handling
app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(err.status || 500).json({
    error: err.message,
    requestId: req.id,
  });
});

app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
Basic Express Setup Basic Express Setup
Middleware Chain Implementation Middleware Chain Implementation
Database Integration (PostgreSQL with Sequelize) Database Integration (PostgreSQL with Sequelize)
Authentication with JWT Authentication with JWT
RESTful Routes with CRUD Operations RESTful Routes with CRUD Operations
Error Handling Middleware Error Handling Middleware
Environment Configuration Environment Configuration

Best Practices

✅ DO

  • Use middleware for cross-cutting concerns
  • Implement proper error handling
  • Validate input data before processing
  • Use async/await for async operations
  • Implement authentication on protected routes
  • Use environment variables for configuration
  • Add logging and monitoring
  • Use HTTPS in production
  • Implement rate limiting
  • Keep route handlers focused and small

❌ DON'T

  • Handle errors silently
  • Store sensitive data in code
  • Use synchronous operations in routes
  • Forget to validate user input
  • Implement authentication in route handlers
  • Use callback hell (use promises/async-await)
  • Expose stack traces in production
  • Trust client-side validation only
general reviews

Ratings

4.510 reviews
  • Shikha Mishra· Oct 10, 2024

    nodejs-express-server is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Piyush G· Sep 9, 2024

    Keeps context tight: nodejs-express-server is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chaitanya Patil· Aug 8, 2024

    Registry listing for nodejs-express-server matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Sakshi Patil· Jul 7, 2024

    nodejs-express-server reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ganesh Mohane· Jun 6, 2024

    I recommend nodejs-express-server for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Oshnikdeep· May 5, 2024

    Useful defaults in nodejs-express-server — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Dhruvi Jain· Apr 4, 2024

    nodejs-express-server has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Mar 3, 2024

    Solid pick for teams standardizing on skills: nodejs-express-server is focused, and the summary matches what you get after install.

  • Pratham Ware· Feb 2, 2024

    We added nodejs-express-server from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Yash Thakker· Jan 1, 2024

    nodejs-express-server fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.