Welcome to ImageHub, a repository for mangaing your images! ImageHub is built using MongoDB, Express, React and Node for a smooth dev experinece and ease of use.
- Clone the application to your machine with
https://github.com/sulemanmalik/ImageHub.git - Start the backend server which will run on
localhost:3000by navigating to the root of the project and runningyarn start - Start the frontend server wich will run on
localhost:3001by navigating to the root of the project and then tofrontend/and runningyarn start - Navigate to
localhost:3001in your browser and start using ImageHub
The Rest API exposes several endpoints which can be used to manage images, users and orders.
| Parameters | Description |
|---|---|
| URL | /images |
| Method | GET |
| URL params | n/a |
| Data params | n/a |
Sample Call
axios.get('http://localhost:3000/images')
| Parameters | Description |
|---|---|
| URL | /images |
| Method | POST |
| URL params | n/a |
| Data params | form data {title, price, imageURL} |
| Sample Call |
axios({
method: "POST",
mode: "no-cors",
url: "http://localhost:3000/images",
data: formData,
config: {
headers: {
"content-type": "multipart/form-data"
}
}
});
| Parameters | Description |
|---|---|
| URL | /images:imageId |
| Method | GET |
| URL params | :imageId |
| Data params | n/a |
Sample Call
axios.get('http://localhost:3000/images/:imageId')
| Parameters | Description |
|---|---|
| URL | /images:imageId |
| Method | PATCH |
| URL params | :imageId |
| Data params | `[{"property": "title" |
Sample Call
axios({
method: "PATCH",
mode: "no-cors",
url: "http://localhost:3000/images",
data: [{"property": "title" || "price", "value": "new value"}],
config: {
headers: {
"content-type": "multipart/form-data"
}
}
});
| Parameters | Description |
|---|---|
| URL | /images:imageId |
| Method | DELETE |
| URL params | :imageId |
| Data params | n/a |
Sample Call
axios.delete('http://localhost:3000/images/:id')