CDN
CDN URL을 생성하는 유틸리티 함수입니다.
Import
ts
import { getCdnUrl } from '@liner-engineering/orbit-core';getCdnUrl
Liner CDN의 전체 URL을 생성합니다.
사용법
ts
const imageUrl = getCdnUrl('/images/logo.png');
// -> 'https://assets.getliner.com/images/logo.png'
const videoUrl = getCdnUrl('/videos/intro.mp4');
// -> 'https://assets.getliner.com/videos/intro.mp4'API
ts
function getCdnUrl(path: string): string;| 파라미터 | 타입 | 설명 |
|---|---|---|
path | string | CDN 리소스 경로 (슬래시로 시작) |
반환값
string - 완전한 CDN URL
예시
tsx
import { getCdnUrl } from '@liner-engineering/orbit-core';
function Logo() {
return <img src={getCdnUrl('/images/logo.svg')} alt="Liner" />;
}참고
CDN 베이스 URL은 https://assets.getliner.com입니다.