Junior — Middle
Describe your experience working with the Express framework in projects
sobes.tech AI
Answer from AI
In projects, I used Express to create REST APIs and server-side logic. I typically set up routes for handling HTTP requests, used middleware for error handling and authentication, and integrated Express with databases via ORM or drivers.
Example of a simple server on Express:
const express = require('express');
const app = express();
app.use(express.json());
app.get('/users', (req, res) => {
res.json([{ id: 1, name: 'Ivan' }, { id: 2, name: 'Maria' }]);
});
app.post('/users', (req, res) => {
const user = req.body;
// Logic to save user
res.status(201).json(user);
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
I also have experience setting up middleware for logging and CORS handling.