In this post, I will show you how to build a blog web API in Node.JS. This tutorial uses Express.JS for handling HTTP requests and Mongodb for storing data.
React.js does not support routing out of the box. React Router is one of the very popular library that is used with React.js to enable routing.
Hook Router is a new library for enabling routing in react.js. It is built around react hooks. It is very simple and small. It comes with a simple and neat documentation. A new fresh react developer can easily get hands dirty with it.
In this lesson I dive into react routing using
hookrouter.js . We are going to create some routing with some navigation links.
An example is easier to understand. I try to…
React components can store a set of observable properties called states. React can decide how to render itself based on the state values. Sometimes it is important to share the state between multiple components by passing the state down through the component tree. When the component tree is too deep and the application becomes bigger, passing states using props through all these components creates a big mess.
Context aims to solve this issue. It stores all states in a central place and shares the states between the components without having to pass them down through the component tree. React Context…
In this post, I will try to explain React — Integration with third-party libraries.
When I started working on React.js last year, I faced a big problem. Integrating React.js with…
In this post, I will show you how to integrate JWT authentication into Express.js applications using jsonwebtoken.
We need to secure user’s data from being changed or displayed without permission. There are many types of authentications. We usually secure web APIs using JWT authentication. This method suits best for web APIs. It does not require to store cookies on client or sessions on the server. It is a stateless way of authorizing resources. It is super easy to implement. It is very popular method for authenticating web APIs among the others.
Today, we can find many apps and websites that upload images like photo sharing apps or blog websites. That is why, there are many good reasons to allow users store files on server. Http servers handle file uploading using POST requests. The case is different while talking about node.js. It is hard for node.js alone without using a library to handle uploading. That is the reason, there are many npm packages available. Multer is a good uploading npm package. It is mainly used with express.js.
Building web APIs is easy…
“Test-driven development (TDD) is a way of managing fear during programming” — Kent Beck
TDD which stands for test driven development is a way of building software applications. This approach adds extra complexity to the process. Developer has to write extra code — test cases. TDD makes sure that the piece of code is doing the required task before releasing. It makes sure the code can be changed easily as business requirement tends to change. The process consists of three main steps: Writing failing tests, writing code that satisfies tests and refactoring.