Br. Space: for trends, developments and BIM.
-
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…
-
React 이메일 형식 체크
React에서 이메일 아이디 형식을 체크하는 정규식 코드는 다음과 같습니다. 위 코드에서 emailRegex는 이메일 주소의 형식을 나타내는 정규식입니다. 정규식은 /…/으로 묶여 있으며, ^는 문자열의 시작을 나타내고, $는 문자열의 끝을 나타냅니다. [^\s@]+는 공백이나 @가 아닌 문자열이 1개 이상 있는 것을 의미하고, \.는 . 문자를 나타냅니다. 위 코드에서 validateEmail 함수는 이메일 주소가 유효한지 검사합니다. test 함수를 사용하여 emailRegex와…
-
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…
-
ASP.NET Core에서 JWT 인증 구현하기
ASP.NET Core에서 JWT 인증을 구현하려면 다음과 같은 단계를 거칩니다. 1. NuGet 패키지 설치하기 ASP.NET Core에서 JWT 인증을 구현하려면 Microsoft.AspNetCore.Authentication.JwtBearer NuGet 패키지를 설치해야 합니다. 이 패키지는 JWT 인증을 구현하는 데 필요한 클래스와 미들웨어를 제공합니다. 2. JWT 인증 설정하기 다음으로, Startup.cs 파일의 ConfigureServices 메서드에서 JWT 인증을 설정합니다. 아래는 예시 코드입니다. 위 코드에서 AddAuthentication 메서드를 호출하여 JWT 인증을…
-
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…
-
비밀번호 대문자, 숫자, 특수문자 중 두 가지 이상 조합
다음은 비밀번호 변경 시 대문자, 숫자, 특수문자 중 적어도 두 가지 이상의 조합을 체크하는 React 코드입니다. 이 코드는 비밀번호 입력 필드에 입력된 값이 변경될 때마다, 대문자, 숫자, 특수문자 중 몇 가지가 포함되어 있는지 체크하여 조건에 따라 오류 메시지를 노출합니다. 위 코드에서는 사용되는 정규식 regex이 변경됩니다. 정규식은 비밀번호가 대문자, 소문자, 숫자, 특수문자 중 2개 이상의 조합을…
-
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.
-
React 앱을 IIS 웹 사이트 하위 디렉터리에 배포하기 (web.config)
1. npm run build 명령을 사용하여 React 앱을 빌드합니다. 이 명령은 컴파일된 에셋과 파일이 들어 있는 build 폴더를 만듭니다. 2. IIS 관리자를 열고 사용하려는 웹 사이트 하위에 새 가상 디렉터리를 만듭니다. 3. 가상 디렉터리 속성에서 물리적 경로를 단계 1에서 만든 build 폴더로 설정합니다. 4. 가상 디렉터리 속성에서 애플리케이션 풀을 상위 웹 사이트에서 사용하는 것과 동일한…
-
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…
-
React 앱 IIS 가상디릭토리 이용 하위 배포 (BrowserRouter)
IIS에 기존 사이트가 있을 때 하위 경로를 이용하여 마이크로 서비스를 하고 싶은 경우가 많다. https://www.example.com/verification React 앱은 기본적으로 루트 경로로 이용되도록 Home이 설정되어 있으므로 하위 서비스는 몇 가지 처리를 해줘야 한다. 1. BrowserRouter (react-router-dom) basename 설정 App.js 파일 BrowserRouter의 기본 props인 basename을 하위 경로로 설정한다. 2. package.json “homepage” 값 추가 여기에는 호스팅 될 전체 주소를…