- Created Express application in backend/src/server.js - Installed dependencies: express, cors, helmet, dotenv, express-validator - Installed dev dependencies: nodemon, eslint, globals - Configured middleware: CORS (frontend origin), Helmet (security), JSON parser - Loaded environment configuration via dotenv - Server listens on port from API_PORT env variable (default: 3001) - Implemented error handling middleware for validation and server errors - Created health check endpoint: GET /api/health returns status and timestamp - Added npm scripts: dev (nodemon), start (production), lint - Configured ESLint for Node.js/Express with CommonJS - Created backend/.env with all required environment variables All acceptance criteria met: ✅ Express application created in backend/src/server.js ✅ All required dependencies installed ✅ Middleware configured (CORS, Helmet, JSON parser) ✅ Environment configuration via dotenv ✅ Server listens on env port ✅ Error handling middleware implemented ✅ Health check endpoint working ✅ Package.json scripts: dev, start, lint ✅ ESLint configured for Node.js/Express Tested and verified: - ESLint passes with no errors - Server starts successfully - Health endpoint returns correct JSON - Changed default port to 3001 (3000 occupied) 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
22 lines
393 B
JavaScript
22 lines
393 B
JavaScript
const globals = require('globals');
|
|
|
|
module.exports = [
|
|
{
|
|
files: ['**/*.js'],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'commonjs',
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'no-console': 'off',
|
|
},
|
|
},
|
|
{
|
|
ignores: ['node_modules/**', 'dist/**'],
|
|
},
|
|
];
|