nodejs-express-server by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill nodejs-express-server遵循行业最佳实践,创建具有适当路由、中间件链、身份验证机制和数据库集成的健壮 Express.js 应用程序。
最小工作示例:
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}`);
});
references/ 目录中的详细实现:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 指南 | 内容 |
|---|---|
| 基础 Express 设置 | 基础 Express 设置 |
| 中间件链实现 | 中间件链实现 |
| 数据库集成(PostgreSQL 与 Sequelize) | 数据库集成(PostgreSQL 与 Sequelize) |
| 使用 JWT 进行身份验证 | 使用 JWT 进行身份验证 |
| 具有 CRUD 操作的 RESTful 路由 | 具有 CRUD 操作的 RESTful 路由 |
| 错误处理中间件 | 错误处理中间件 |
| 环境配置 | 环境配置 |
每周安装量
457
仓库
GitHub 星标数
116
首次出现
Jan 21, 2026
安全审计
安装于
opencode385
gemini-cli375
codex371
github-copilot353
amp302
kimi-cli298
Create robust Express.js applications with proper routing, middleware chains, authentication mechanisms, and database integration following industry best practices.
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}`);
});
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 |
Weekly Installs
457
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
opencode385
gemini-cli375
codex371
github-copilot353
amp302
kimi-cli298
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
136,300 周安装
OpenAPI 转 TypeScript 工具 - 自动生成 API 接口与类型守卫
563 周安装
数据库模式设计器 - 内置最佳实践,自动生成生产级SQL/NoSQL数据库架构
564 周安装
Rust Unsafe代码检查器 - 安全使用Unsafe Rust的完整指南与最佳实践
564 周安装
.NET并发编程模式指南:async/await、Channels、Akka.NET选择决策树
565 周安装
韩语语法检查器 - 基于国立国语院标准的拼写、空格、语法、标点错误检测与纠正
565 周安装
技能安全扫描器 - 检测Claude技能安全漏洞,防范提示注入与恶意代码
565 周安装
| Environment Configuration |