{"id":17444482,"url":"https://github.com/jameskyburz/serve-create-react-app","last_synced_at":"2026-05-10T03:54:20.652Z","repository":{"id":92962644,"uuid":"94431027","full_name":"JamesKyburz/serve-create-react-app","owner":"JamesKyburz","description":"serve-create-react-app","archived":false,"fork":false,"pushed_at":"2019-10-04T08:43:21.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T00:53:35.489Z","etag":null,"topics":["create-react-app","javascript","nodejs","react","serve","server"],"latest_commit_sha":null,"homepage":"https://npm.im/serve-create-react-app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesKyburz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-06-15T11:02:03.000Z","updated_at":"2019-10-04T08:43:17.000Z","dependencies_parsed_at":"2023-03-04T20:00:27.518Z","dependency_job_id":null,"html_url":"https://github.com/JamesKyburz/serve-create-react-app","commit_stats":{"total_commits":82,"total_committers":4,"mean_commits":20.5,"dds":"0.23170731707317072","last_synced_commit":"768116208b8c24f94e060873cc2c4f99d3d7d581"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fserve-create-react-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fserve-create-react-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fserve-create-react-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesKyburz%2Fserve-create-react-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesKyburz","download_url":"https://codeload.github.com/JamesKyburz/serve-create-react-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569131,"owners_count":20959758,"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":["create-react-app","javascript","nodejs","react","serve","server"],"created_at":"2024-10-17T17:27:44.652Z","updated_at":"2026-05-10T03:54:20.608Z","avatar_url":"https://github.com/JamesKyburz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serve-create-react-app\n\n[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard)\n[![downloads](https://img.shields.io/npm/dm/serve-create-react-app.svg)](https://npmjs.org/package/serve-create-react-app)\n[![Greenkeeper badge](https://badges.greenkeeper.io/JamesKyburz/serve-create-react-app.svg)](https://greenkeeper.io/)\n\nserve [create-react-app](https://github.com/facebookincubator/create-react-app) using [serve](https://github.com/zeit/serve) as a single page application.\n\nuse when you want a backened to your react app.\n\n# example\n\nserver\n\n```javascript\nprocess.env.REACT_APP_BUILD=[path to react app build directory]\n// base url set by process.env.PUBLIC_URL\nconst serve = require('serve-create-react-app')('COOKIE_NAME_FOR_BASE_URL')\nawait serve(req, res)\n```\n\n# build\n```sh\nserve-create-react-app [path-to-react]\n```\n\n# usage when pathname is not root\n\nMake sure homepage is \".\" in your react app's `package.json`.\n\nThis is documented [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#serving-the-same-build-from-different-paths)\n\nThen when running set `process.env.PUBLIC_URL`\n\n# usage when pathname is root\n\nMake sure homepage is not added to react app's `package.json`.\n\nRun without setting `process.env.PUBLIC_URL`\n\n# example Dockerfile\n```dockerfile\nFROM jameskyburz/node:8.0.0-alpine\n\nENV REACT_APP_BUILD /usr/src/app/src/ui/build\n\nRUN ./node_modules/.bin/serve-create-react-app\n\nUSER node\n\nEXPOSE 5000\n```\n\n# example Docker run\n\n```sh\ndocker run my-image -e PUBLIC_URL=/foo\n```\n\n# license\n\n[Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Fserve-create-react-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjameskyburz%2Fserve-create-react-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameskyburz%2Fserve-create-react-app/lists"}