ideabrowser.com — find trending startup ideas with real demand
Try itnpx skills add https://github.com/aj-geddes/useful-ai-prompts --skill nodejs-express-serverCreate 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 |
| Environment Configuration | Environment Configuration |