[카테고리:] Web
-
Here’s a regular expression code in React for checking the email ID format
In the above code, emailRegex is the regular expression that represents the email address format. The regular expression is enclosed in /…/, where ^ represents the start of the string and $ represents the end of the string. [^\s@]+ represents one or more non-space and non-@ characters, and \. represents the . character. The validateEmail…
-
Implementing JWT Authentication between ASP.NET Core and React
JSON Web Token (JWT) authentication is a widely used authentication method in web development. In this blog post, we will discuss how to implement JWT authentication between an ASP.NET Core backend and a React frontend. Introduction JSON Web Token (JWT) is an open standard for creating tokens that securely transmit information between parties. JWT authentication…
-
Combination of at least two of uppercase letters, numbers, and special characters
The following is React code that checks at least two combinations of uppercase letters, numbers, and special characters when changing passwords. Whenever the value entered in the password input field is changed, this code checks whether some of uppercase letters, numbers, and special characters are included, and exposes an error message according to conditions. In…
-
To deploy a React app in a subdirectory of an IIS website, you can use an IIS virtual directory (web.config)
This code will rewrite any incoming request to the subdirectory to the index.html file inside the build folder. Your React app should now be accessible in the subdirectory you specified, and all the routes should work as expected.
-
To deploy a React app in a subdirectory of an IIS website (BrowserRouter)
When there is an existing site in IIS, there are many cases where you want to do microservices using sub-paths. https://www.example.com/verification Since Home is set to be used as the root path by default in React apps, subservices need to do some processing. 1. Set BrowserRouter (react-router-dom) basename Set the basename, the default props of…