Setup
First, install the necessary packages with:
npm install express cors mongoose
Code
Then, add dependencies to server.js, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB:
var express = require('express');
var cors = require('...