跳到正文
cccskills
免费在 GitHub 公开

nodejs-express-server

Build production-ready Express.js servers with middleware, authentication, routing, and database integration. Use when creating REST APIs, managing requests/responses, implementing middleware chains, and handling server logic.

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works星标 182(GitHub 182 + cccskills 0)
集成工具PostgreSQL

实测评分 未实测

查看安装方法

包含的文件(9)

  • SKILL.md3.8 KB
  • references/authentication-with-jwt.md790 B
  • references/basic-express-setup.md616 B
  • references/database-integration-postgresql-with-sequelize.md756 B
  • references/environment-configuration.md440 B
  • references/error-handling-middleware.md834 B
  • references/middleware-chain-implementation.md979 B
  • references/restful-routes-with-crud-operations.md1.7 KB
  • scripts/security-checklist.sh734 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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/ work:

GuideContents
Basic Express SetupBasic Express Setup
Middleware Chain ImplementationMiddleware Chain Implementation
Database Integration (PostgreSQL with Sequelize)Database Integration (PostgreSQL with Sequelize)
Authentication with JWTAuthentication with JWT
RESTful Routes with CRUD OperationsRESTful Routes with CRUD Operations
Error Handling MiddlewareError Handling Middleware
Environment ConfigurationEnvironment 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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

ai-sdk

免费

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email/password authentication. Use when users need to set up login, sign-in, sign-up, credential authentication, or password security with Better Auth.

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

Repo-specific guide to the Ever Works monorepo (ever-works/ever-works) — its pnpm + Turborepo layout, the per-workspace test runners (Jest vs Vitest vs Playwright), file-naming and import-alias conventions, the commit/branch model, and the real build/lint/type-check commands. Use this whenever working anywhere in this repository so changes match the codebase's actual conventions and pass CI.

中文简介正在准备中。当前显示原文说明。

ever-works/ever-works1822026年10月24日 更新

查看 ever-works 的全部技能

报告此技能的问题