Built-in API rate limiter, new in .NET 7
Rate limiter is a new feature introduced in Microsoft .NET 7. Before .NET 7, we had to use 3rd party packages to add rate limit in our APIs. What is Rate Limit? In simple words, it is the maximum number of requests the API is allowed to accept in a given time. For example you can set the limit to 10 requests per minute. With this setting, the API will only accept 10 requests and reject the 11th and subsequent requests....
How to display error message in React
We can display the error message by setting the state variable. If there is an error doing something, catch the exception and set the state variable as below. const [errorMessage, setErrorMessage] = useState(""); const doSomething = () => { // call some api or do something, if there is any error set message setErrorMessage("Some error has occurred."); }; And just display the error message wherever you want with the && operator as below....
Massively Improve Search Query Performance by Index Columns
While making the AddressBook app, I wanted to work on more than one million rows in a database. The goal is to make it work on a cheap 2 core VPS, under $15 monthly budget. After adding 1M+ rows, the search queries were not performing well. On a fresh install the response time ranged from 1 to 10 seconds. But I got some other sites hosted on the same VPS, so when I checked back the AddressBook after some time, the Search was not working at all....
My top 4 most used VS Code Extensions for React coding
The marketplace of Visual Studio Code has grown a lot. VS Code has become the most popular code editor, because it has support of extensions from 3rd party developers and companies. Below are the extensions I can’t live without Live Server by Ritwick Dey Bracket Pair Colorization Toggler by Dzhavat Ushev Prettier – Code formatter by prettier.io ES7+ React/Redux/React-Native snippets by dsznajder