Now it's time to execute the application and upload some photos:
Open your terminal/shell and type the following command:
npm start
Go to
http://localhost:3000/books
and you will see the following screen:
Now let's insert some images and check the behavior of our application:
Go to
http://localhost:3000/books/add
, and fill in the form:Add the following information:
Title: Image Sample 02
File: choose the sample02.jpg file.
Category: cities
Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Let's check our MongoDB to see what happens before we go further.
Open your
RoboMongo
and select the first object:When we upload an image, the API returns a JSON with all information related to that image. We store this JSON as...