Originally known as Membase, is an open-source, distributed (shared-nothing architecture) multi-model NoSQL document-oriented database software package optimized for interactive applications. These applications may serve many concurrent users by creating, storing, retrieving, aggregating, manipulating and presenting data.
So here we will be setting up a CouchBase cluster of 2 nodes (master…
Hadoop is a tool to distribute systems. Here we will be using it to set up a 3 node system, one master and 2 slaves.
Setting the network configuration on the Master (or primary).
Imagine a phone app that would tell you if the people around you (who would also have the app) are or not vaccinated. This API would help the app off load some of the processing, and ease the deployment of new features.
To start we will need a simple calculator api to then document.
To keep it simple here is how your folder structure needs to look like.
Then we will add the following packages with npm.
npm i -s swagger-ui-express express
Now our main.js (index.js) code:
Now lets tackle the swaggerdoc.json in parts.
1st we need to give the project a description:
2nd, in order to not repeat ourselves in each endpoint with what could be a lot, we create a schema component.
3rd we can now start making the endpoints actual documentation.
Lets try to get a loopback api that allows for upload and download of files.
After you start an api with
lb4 apiname we will get the dependency:
npm i -s @types/multer
Now we need to add 2 controllers with
file — upload and file download:
Swagger UI is a common way of exposing your API in a human friendly way.
Assuming you already have an API with well structured entry and exit points, but you don’t have a way to show/test them without using external tools like postman, and you want expose it to your…
There are times when we need to delay something in node.
One of the best tools for the job is setTimeout().
setTimeout() and setInterval() are 2 functions implemented by nodejs itself, as they belong to the global object they can be called anywhere in the code, even without the object…