{"id":22234847,"url":"https://github.com/chinsun9/hello-react","last_synced_at":"2025-07-04T02:34:15.123Z","repository":{"id":126361585,"uuid":"390930242","full_name":"chinsun9/hello-react","owner":"chinsun9","description":"react spa example","archived":false,"fork":false,"pushed_at":"2021-07-30T05:26:33.000Z","size":447,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T09:25:44.784Z","etag":null,"topics":["example","react","spa"],"latest_commit_sha":null,"homepage":"https://chinsun9.github.io/hello-react/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinsun9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-30T04:31:14.000Z","updated_at":"2021-07-30T05:26:35.000Z","dependencies_parsed_at":"2023-06-16T10:15:30.916Z","dependency_job_id":null,"html_url":"https://github.com/chinsun9/hello-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chinsun9/hello-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinsun9%2Fhello-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinsun9%2Fhello-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinsun9%2Fhello-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinsun9%2Fhello-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinsun9","download_url":"https://codeload.github.com/chinsun9/hello-react/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinsun9%2Fhello-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263434339,"owners_count":23465945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","react","spa"],"created_at":"2024-12-03T02:09:53.978Z","updated_at":"2025-07-04T02:34:15.076Z","avatar_url":"https://github.com/chinsun9.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello react\n\nreact spa 만들고 github pages에 올리고 자랑하기\n\n## gh-pages 설치\n\n```sh\nyarn add -D gh-pages\n```\n\n## package.json 수정\n\n```jsonc package.json\n{\n  // ...\n  \"scripts\": {\n    // ...\n    \"deploy\": \"gh-pages -d build\"\n  },\n  // ...\n  \"homepage\": \"https://chinsun9.github.io/hello-react/\"\n}\n```\n\n- `deploy` 스크립트 추가, `homepage` 필드를 추가한다\n- 이때 `homepage`필드의 값은\n- `https://{username}.github.io/{repo}/`로 한다\n\n## Router에 basename 추가\n\n```jsx index.js\nReactDOM.render(\n  \u003cReact.StrictMode\u003e\n    \u003cRouter basename={process.env.PUBLIC_URL}\u003e\n      \u003cApp /\u003e\n    \u003c/Router\u003e\n  \u003c/React.StrictMode\u003e,\n  document.getElementById(\"root\")\n);\n```\n\n- 최상위 Router에 `basename={process.env.PUBLIC_URL}`을 추가한다\n\n## 404.html 추가\n\n- https://github.com/rafgraph/spa-github-pages/blob/gh-pages/404.html\n- `public/404.html`을 만들고 위 내용을 추가한다\n- 이때 다른점은 `pathSegmentsToKeep` 값을 1로 한다\n\n## index.html 수정\n\n- https://github.com/rafgraph/spa-github-pages/blob/gh-pages/index.html\n- `public/index.html` head 부분에 위 `\u003c!-- Start Single Page Apps for GitHub Pages --\u003e` 에 해당하는 스크립트 부분을 추가한다\n\n## build\n\n```\nyarn build\n```\n\n## deploy\n\n```\nyarn deploy\n```\n\n- gh-pages 브랜치가 생성되어 있고,\n- 깃허브 페이지 기능이 활성화되어있는 것을 확인할 수 있을 것이다\n\n## 참고\n\n- https://github.com/rafgraph/spa-github-pages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinsun9%2Fhello-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinsun9%2Fhello-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinsun9%2Fhello-react/lists"}