Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 2.45 KB

README.MD

File metadata and controls

113 lines (78 loc) · 2.45 KB

API Information

This API can add images and send them to a MongoDB database. Using the /image/id search param you can search for your images by their ID and have the image rendered infront of you.

Tech Stack:

Node.js | Express.js | MongoDB/Mongoose | Postman

Article Link

Here is an article for more information about the source code: https://noor-ahmed.hashnode.dev/create-and-deploy-image-api

API Links

https://image-api-f8qs.onrender.com

Upload An Image

https://image-api-f8qs.onrender.com/upload

Use Postman for adding images or any other API service.

Search for an Image

https://image-api-f8qs.onrender.com/image/id

ID's to search through

64e76e4e53ead60703895ba5
64e76f7e6fbe37fb8474d93b
64edba179a581d5a79deec98
64edbaab9a581d5a79deec9b

Cool Tiktok Sounds

664655f27ad5ac4ba5177b85
66477d571117960956372a36
66477d881117960956372a38

PDF'S

6649f21da6756d4843d9ddcc
6649f384a6756d4843d9ddcf

Install Dependencies

npm install

Run Node API

First remember to cd into your directory and then write this command:
nodemon app.js

Hosting Service:

Currently the API is being hosted using onrender which is a free hosting service: https://render.com. If you want to host it yourself or if you want to make some changes to the API then here I will discuss a few things you will need to know.

Deploy API

All of the steps for deployment can be found in this video: https://www.youtube.com/watch?v=bnCOyGaSe84&ab_channel=CodeBrah

Deploy API with hidden .env or config.js file

In order to deploy the API to onrender with a hidden .env you can follow this tutorial, go to 16:24 in the tutorial: https://www.youtube.com/watch?v=68ubggfsQlE

If you have a hidden config.js file or any other named file with the mongodb uri then on render.com when you go on environment, navigate to Secret Files and fill in the details for your config.js file there instead of environment variables:


Please make sure to setup a MongoDB cluster before you use this API. Here is an informative tutorial on how you can do this: https://www.youtube.com/watch?v=s0anSjEeua8&ab_channel=TheNetNinja