본문 바로가기

전체보기

(71)
[c#] Globel Exception Deligation Handler // 참조 // https://stackoverflow.com/questions/13013973/asp-net-web-api-default-error-messages // DelegatingHandler : 내부 핸들러라고 하는 다른 핸들러에 HTTP 응답 메시지 처리를 위임하는 HTTP 핸들러의 유형입니다. // https://learn.microsoft.com/ko-kr/dotnet/api/system.net.http.delegatinghandler?view=netframework-4.8 // http://www.egocube.pe.kr/Translation/Content/asp-net-web-api/201309040001 public class GlobalExceptionDeligatingHandl..
9. next.js 쿠키 사용 1. Server Side 에서 API로 쿠키 보내기 const strUrl = process.env.NEXT_PUBLIC_URL_API + "/todolist"; const res = await axios.get(strUrl, { headers: context.req ? { cookie: context?.req?.headers?.cookie } : undefined }) 2. Client Side 에서 API로 쿠키 보내기 const strUrl = process.env.NEXT_PUBLIC_URL_API + "/todolist"; const res = await axios.get(strUrl, { withCredentials: true }) 3. 서버측 CORS 확인 - ASP.NET WEBAPI -..
8. next.js 개발환경에서 인증서 없이 HTTPS 사용하기 - 프록시 설정 - 개발자 PC에서 실행 local-ssl-proxy 설치 : 별도의 CMD에서 실행 $ npm install -g local-ssl-proxy $ local-ssl-proxy --source 3001 --target 3000 => 자동 실행 할수 있도록 확인 필요 https://www.npmjs.com/package/local-ssl-proxy - next.js 설정 동일하게 실행후 접근 확인 http://client.test.com:3000 https://client.test.com:3001 인증되지 않은 인증서이지만 한번 확인하면 사용 가능
7. next js : dotnet에서 EUC-KR 로 HttpUtility.UrlDecode 된 2차원 배열 쿠키 사용 yarn add decode-uri-component-charset https://github.com/gtgalone/decode-uri-component-charset#readme import cookies from 'next-cookies'; import { decodeURIComponentCharset } from 'decode-uri-component-charset'; .... export function Get(context: any) : IAuthManager { let authMgr : IAuthManager = init(); let allCookie = cookies(context); if(!(typeof allCookie === 'undefined' || allCookie=== null)..
6. next js 사용자 별 페이지 접근 제어 - HOC - 참조 https://github.com/vercel/next.js/discussions/10925#discussioncomment-12471 - /hoc/withAuthServerSide.tsx import { Toast } from "antd-mobile"; import { checkPrime } from "crypto"; import { useRouter } from "next/router"; import React from "react"; import * as AuthManager from '../components/manager/AuthManager' export interface AccesResultModel { canAccess :boolean; retUrl : string; message..
5. next js 서버 배포 및 실행 - IIS ( Windows Server 2008 R2, IIS7 기준) - 참조 deploy next js on iis web server https://www.youtube.com/watch?v=HLsx0iraA-Y 0. node 설치 windows server 2008 R2 에서 최신 버전 설치 불가 16.x, 14.x 설치불가 12.x 로 설치 : node-v12.22.7-x64.msi https://nodejs.org/download/release/latest-v12.x/ 1. IISNODE 설치 https://github.com/tjanczuk/iisnode 2. URL rewrite module for IIS https://www.iis.net/downloads/microsoft/url-rewrite 3. 서버폴더에 배포 [C:\iis_node] [.next] -..
4. next js 프로젝트 SVN으로부터 프로젝트 Checkout 받아서 실행하기 0. Visual Studio Code > 보기 > 터미널 실행 후 아래 경로로 이동 PS D:\Workspace\REACT> 1. SVN 에서 checkout 프로젝트 Cntl + Shipt + P > SVN:Checkout Repository URL : https://svn.mysvn.co.kr:8443/svn/React/nextjs-sample-app 폴더선택 : D:\Workspace\REACT\ 폴더이름 : nextjs-sample-app-checkout * 확인을 위해 폴더이름을 다른곳에 생성하여 chekcout 시킵니다. 2. yarn install node_modules 에 패키지들 설치 3. 확인 http://localhost:3000/
3. next js 프로젝트 생성 및 SVN 연동 및 chekcout 까지 진행 0. 요약 VSCode 에서 checkin 하는 방법을 찾지 못하여 반대로 진행 기존 서비스를 위해 SVN을 사용하고 있고, 최초 react 도입 시점에 버전관리툴은 유지 app 이름 : nextjs-sample-app 1. SVN Repository 내 저장소 생성 React > nextjs-sample-app 2. next js app 생성 PS D:\Workspace\REACT> PS D:\Workspace\REACT> yarn create next-app --typescript nextjs-sample-app 3. SVN Checkout 으로 생성한 프로젝트 폴더와 연결 VSCode > 보기 > 터미널 열어 Cntl + Shipt + P > SVN:Checkout Repository URL : h..