깃허브에 json 데이터를 CDN으로 사용하는 방법입니다.
깃허브에 json 데이터 파일을 업로드 합니다.
ex
[
{
"id" : 3,
"title" : "Flowey",
"content" : "only 5 inches",
"price" : 120000
},
{
"id" : 4,
"title" : "Baby shoes",
"content" : "for less than 6",
"price" : 120000
},
{
"id" : 5,
"title" : "Red Herring",
"content" : "Born in France",
"price" : 120000
}
]
data2.json
올리고 파일을 열어봅니다.
https://github.com/lshjju/data/blob/main/data2.json
raw 파일이 필요하다면
오른쪽 상단에 raw 라는 버튼이 있습니다.
그걸 클릭하면 파일이 하나 열리는데 그 브라우저 URL이 raw 파일입니다.
그 url 을 사용하면 됩니다.
https://raw.githubusercontent.com/lshjju/data/refs/heads/main/data2.json
'New' 카테고리의 다른 글
| WAS - Web Application Server (7) | 2025.08.13 |
|---|---|
| Web Framework (3) | 2025.08.13 |
| github CDN image absoute path (0) | 2025.08.04 |
| H2 database (0) | 2025.07.25 |
| JS console.log - 자바스크립트 데이터 콘솔로 체크하기 (0) | 2025.06.21 |