A simple Node.js and Express-based server to handle image uploads using Multer. This application automatically manages the uploads
directory and provides an endpoint to upload and access images programmatically.
- Upload images via the
/upload
endpoint. - Automatically manages the
uploads
folder (no need to create it manually). - Serves uploaded images through a static
/uploads
route. - Provides meaningful feedback on successful uploads.
- clone the repository
- install the dependencies with
npm i
- run it using
npm start
- use postman or httpie to make a request
- enter url
http://localhost:5000/upload
and usePOST
- from body choose
form
orfile
- enter valid key
image
and upload your image - hit send to make the api call
{ "message": "File uploaded successfully", "path": "http://localhost:5000/uploads/your-file-name" }
Happy coding ❤️