This is a simple Node.js + Express project with image upload support using multer. It allows you to:
- β
Get a list of user profiles (
GET /api/form) - β
Add a new user profile with an image (
POST /api/form/addUser)
cd Backend
npm install
npm run serverBy default, the backend server runs at
http://localhost:5000
cd Frontend/QuestLab
npm install
npm run devBy default, the frontend runs at
http://localhost:3000
Fetch all user profiles.
Sample Response:
[
{
"firstName": "Ayush",
"lastName": "Singh",
"role": "Full Stack Developer",
"image": "http://localhost:5000/uploads/ayush.jpg",
"linkedin": "https://linkedin.com/in/ayushkumarsingh",
"twitter": "https://twitter.com/ayush_dev"
}
]Add a new user profile with an image (use multipart/form-data).
Fields to send:
firstName(string)lastName(string)role(string)linkedin(string)twitter(string)image(file)
Sample FormData in Postman:
| Key | Type | Value |
|---|---|---|
| firstName | Text | Ayush |
| lastName | Text | Singh |
| role | Text | Full Stack Developer |
| Text | https://linkedin.com/in/ayushkumarsingh | |
| Text | https://twitter.com/ayush_dev | |
| image | File | [Choose File] |
Success Response:
{
"message": "User added successfully"
}- Ensure the
uploads/folder exists in the backend directory to store uploaded images. - Use
corsand proxy configuration if frontend and backend are on different ports during development.