Question: This is Node.js assignment: Write the code to a Mongoose model named vehicle. Include fields for make and model of type string. Write the code

This is Node.js assignment:
Write the code to a Mongoose model named vehicle. Include fields for make and model of type string.
Write the code to wire-up an Express server
Write the code to create a vehicle API that returns an array of 5 vehicle objects using the JSON data type.
Using EJS views, write the code to populate a select box with 5 vehicle objects. Bind the model as the option value and bind the make as the option text.
Using Mongoose, write the code to connect to MongoDB Atlas.
Write a block of code that creates a vehicle class with two fields: make and model. Initialize the fields using the classes constructor. Next, create three instances of the vehicle class for objects named car, truck, and van. Finally, output the objects values using the console.log function.
Write the code to create an NPM module named getVehicles that returns an array of vehicle objects.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!