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
/uploadendpoint. - Automatically manages the
uploadsfolder (no need to create it manually). - Serves uploaded images through a static
/uploadsroute. - 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/uploadand usePOST - from body choose
formorfile - enter valid key
imageand upload your image - hit send to make the api call
{ "message": "File uploaded successfully", "path": "http://localhost:5000/uploads/your-file-name" }
Happy coding ❤️