Code Monkey home page Code Monkey logo

image-uploader-task's Introduction

Image Uploader

This is a simple image uploader API. It uses cloudinary as a storage for the images and saves the secure and unique image URL to mongoDB database.

Table of Contents

General Info

A simple API built with expressjs, mongoDB and cloudinary to save, store and retrieve images.

Documentation

Click this link to view a detailed documentation of this resource.

Prerequisites

To run this API locally or following through the implementation, Node.js runtime environment is required, most preferably, the long term support (LTS) version and mongoDB also.

Modules and Dependencies

The node modules used for this API are

  • Express
  • Mongoose
  • Cloudinary with their versions shown in the package.json file.

Setup

To run this project (i.e. locally), mongodb should be available on your machine or use mongodb Atlas

  • Clone the repo:
git clone https://github.com/VictorChukwudi/image-uploader-task.git
  • Open the folder and run the command to install the dependencies:
npm install
  • Go Cloudinary to sign up or login to get your unique cloud_name, api_key and api_secret

  • Create a .env file in the root and add code below to the file

dbURI= <mongodb_connection_string>
PORT= 2000
CLOUD_NAME=<cloudinary_cloud_name>
API_KEY=<cloudinary_api_key>
API_SECRET=<cloudinary_api_secret>
  • Next, run the command below to start the server
npm run dev

Usage

The Image Uploader API has the routes(endpoints) available for the api usage:

  • POST /upload : to upload an image.
  • GET /get_image/id : to retrieve an immage using the image id.

The routes are appended to the base URL with is

  • for local
http://localhost:2000
  • for deployed
https://image-uploader-x4uk.onrender.com

Deployed

To use the deployed version of the API, the base URL is https://image-uploader-x4uk.onrender.com (with the routes attached for any of the operations)

image-uploader-task's People

Contributors

victorchukwudi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.