CORS Anywhere on Pure NGINX Config

Cross-Origin Resource Sharing (CORS) often becomes a stumbling block for developers attempting to interact with APIs hosted on different domains. The challenge intensifies when direct server configuration isn't an option, pushing developers towards alternative solutions like the widely-used cors-anywhere. However, less known is the capability of NGINX's proxy_pass directive to handle not only local domains and upstreams but also external sources, for example:

This is how the idea was born to write a universal (with some reservations) NIGNX config that supports any given domain.

Removing JavaScript: How To Use HTML With Htmx and Reduce the Amount of Code

HTML as the Center of the Universe

The internet as we know it today is largely due to HTML and CSS. Javascript (JS) could act as a glue between them and make pages more dynamic and interactive, but the history of web programming developed differently. After the emergence of client-side rendering and other similar technologies, it became much more difficult to use JS to create web applications.

What Is Htmx?

Htmx is a library that allows you to create modern and powerful user interfaces with simple markup. Thanks to it, AJAX requests, triggering CSS transitions, calling WebSocket and server-sent events can be performed directly from HTML elements.

MongoDB Basics in 5 Minutes

MongoDB is a document-oriented database management system that does not require any predefined schema.

It is considered one of the classic examples of NoSQL systems. It uses JSON-like documents and a database schema. The database is used in web development, in particular, within the framework of some JavaScript stacks such as MEAN, MEVN, MERN, which are often used by web developers as their favorite tech stacks for creating applications.

Indexers in JavaScript

Some modern object-oriented languages have the concept of indexers, which are properties that allow you to index instances of a class just like arrays by using the [] notation. In this article, I would like to show you how to do it in modern JavaScript.

Here’s an example in C#:

The Right Way to Use Favicons

How to Add a Favicon

To make an icon display, you need to add a file with a graphic image of the icon to a tab. To add an icon to your website, you need to follow the mandatory browser requirements and use a minimum set of favicons, which we will now consider in detail.

Why a set and not a single icon? The fact is that browsers and screens are constantly evolving. More modern formats are usually supported by more modern browsers. For example, you might think that you can add a single SVG icon and the browser will render it correctly. However, not all browsers still support the SVG format for favicons. The following table illustrates the browsers that support the SVG format.

About Using Regexp in Nginx Map

The essence of the Nginx map directive is that it allows you to create a new variable whose value depends on the values of one or more of the source variables. The directive becomes even more efficient when regular expressions are used. However, one important point may be forgotten. Excerpt from the manual:

Since variables are evaluated only when they are used, the mere declaration even of a large number of map variables does not add any extra costs to request processing.

The Drawbacks of MobX

I would like to talk about what I could rarely find in articles covering MobX, about those drawbacks that ruin the impression of use, as well as how to crack this problem. I also need to describe its pros to justify my own choice. So, let’s start.

MobX is a state manager, which now has a new version 6 that works due to Proxy. The further opinion is based on using MobX v6 together with the React library when developing mobile (React Native) and web applications. It is worth clarifying that I used MobX v4, react-easy-state, Redux, Zustand in previous projects, and I’m also familiar with a dozen alternative state managers at the level of reading their documentation. I would also like to note that all the pros and cons listed below aren’t complete and can be detected if compared to other state managers.

Async Support in Django

Hello, my dear readers! Yes, this article is about the web framework for perfectionists with deadlines, as well as Django’s lack of async support. It’s more like an Enhancement Proposal (less formal than it could be) or RFC. So, if you like that sort of thing, you might be interested. 

Django Foundation has also considered the issue of adding async support. Their discussions have resulted in DEP-09, which describes the current approximate roadmap. I have even discovered that my post doesn’t contradict it. It’s just that it has very little information about async-native support. It is considered the last stage that still needs to be reached. This reminds me of a meme about how to draw an owl: first, we draw two circles, and then we finish the rest.