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.
- Скачивания
- 0
- В избранном
- 0
- Комментарии
- 0
- Просмотры
- 1
Установить скилл
Добавьте инструмент одной командой или скачайте проверенный архив версии.
npx skills add aj-geddes/useful-ai-prompts --skill nodejs-express-server- Версия
- 1.0.0+3f5182cfd739
- Автор
- Владимир Ломтев
- Репозиторий
- aj-geddes/useful-ai-prompts
Как установить
- 1Скопируйте команду из блока установки.
- 2Запустите её в терминале из каталога проекта.
Документация
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
Требования и возможности
Источник пакета
https://github.com/aj-geddes/useful-ai-prompts/tree/3f5182cfd739fc113f4af5244a1cf342ad7f7911/skills/nodejs-express-server
Файлы версии
| Путь | Размер | SHA256 |
|---|---|---|
| SKILL.md | 3189 | db24461cdf82e758... |
| references/authentication-with-jwt.md | 832 | a984e4012384fbd2... |
| references/basic-express-setup.md | 626 | 29758e2db919db94... |
| references/database-integration-postgresql-with-sequelize.md | 830 | f025c51f75f93346... |
| references/environment-configuration.md | 462 | 300ef97b318a4fb9... |
Частые вопросы
- Как установить Nodejs Express Server?
- Используйте команду
npx skills add aj-geddes/useful-ai-prompts --skill nodejs-express-serverили скачайте ZIP-архив. - Можно ли скачать Nodejs Express Server бесплатно?
- Да, опубликованную версию можно скачать из маркетплейса бесплатно.
Похожие инструменты
Смотреть всеTerraform Style GuideGenerate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.2ГИС: Матрица расстояний 2ГИСРассчитать время и расстояния между наборами точек.2ГИС: Зона обслуживания на карте 2ГИСПроверить попадание адреса в заданную географическую зону.2ГИС: Статическая карта 2ГИССформировать PNG-карту с точками, линиями или полигонами.
Комментарии
Войдите, чтобы оставить комментарий.
Комментариев пока нет.