Today, we have many options to work with MongoDB, from in-house services to hosting companies that provide Platform as a Service (PaaS) and Software as a Service (SaaS).
We will present a solution called Database as a Service (DbaaS) that provides database services for highly scalable web applications.
Here's a simple step-by-step process to start using a MongoDB instance with a cloud service:
node-api
.mongodb://<user>:<password>@kahana.mongohq.com:10073/node-api.
Let's edit the server.js
file using the following steps:
Mongoose.connect()
function.nodemon server.js
http://localhost:8080/api
.{
Hello SPA, the API is working!
}
api
folder was defined on the server.js
file when we registered the routes:app.use('/api', router);
http://localhost:8080/api/speakers
, you must have something like this: []This is an empty array, because we haven't input any data into MongoDB.
3.15.186.79