[
  {
    "path": ".gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n\n# testing\ncoverage\n\n# production\nbuild\n\n# misc\n.DS_Store\n.env\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\njspm_packages\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\n\nnode_js:\n  - \"4\"\n  - \"5\"\n  - \"6\"\n  - \"stable\"\n\nsudo: false\n\nbefore_script:\n  - export DISPLAY=:99.0\n  - sh -e /etc/init.d/xvfb start\n\nscript:\n  - npm install\n  - npm test"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2016 Kawi Xiao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# create-react-app-now\n\nDeploy React.js Static Web Apps generated with [facebook/create-react-app](https://github.com/facebook/create-react-app) to Zeit's awesome [Now.sh](https://zeit.co/now/) service.\n\nI wrote an article about this project here: [Zero Configuration Deployment for React app with Zeit Now](https://medium.com/@kawixiao/zero-configuration-deployment-for-react-apps-with-zeits-now-4f002be98c#.eyvj3mjdb)\n\n# Important\n\nUPDATE: create-react-app now officially recommend using \"serve\" to deploy your create-react-app project. The documentation can be found here: https://create-react-app.dev/docs/deployment\n\nI personally and strongly recommend you to check out [Next.js](https://zeit.co/blog/next) by Zeit team.\nThat will be my personal go to choice as well when creating new React project, and deploy to now seamlessly.\n\nThough create-react-app-now can serves as an example on how you can use create-react-app and zeit's now together.  \n\nHaving said that, it is likely that I will not actively maintain this repo anymore (e.g. update the dependencies). I will still accept PR though.\n\n# Why\n\ncreate-react-app-now is created using [facebook/create-react-app](https://github.com/facebook/create-react-app).\nAlthough it supports deployment to github pages and heroku, it does not feel intuitive just yet, as we need to run lots of commands.\n\nThis project is specifically to solve just that, with just 1 command: `npm run deploy`\n\nThis is achieved by using Zeit's awesome [Now.sh](https://zeit.co/now/) service.\nIt is fast, easy, and intuitive way of deploying your React app.\n\n# How\n\nSimply follow this step from getting started to deployment:\n\n```\n$ npm install -g now\n$ git clone https://github.com/xkawi/create-react-app-now\n$ npm install\n$ npm run deploy\n```\n\nFirst command installs the `now` cli globally as npm package. Another (or suggested) approach is to install [Now Desktop](https://zeit.co/desktop) to ensure automatic updates of `now` cli.\n\nSubsequent commands simply clone this repo, install necessary npm packages and deploy it to Now.\n\nWhenever you want to deploy new changes, just run `npm run deploy` again to get new public link, for free! :smile:\n\nYou will enjoy all the benefits that Now offers out-of-the-box: real-time and immutable deployments all within 1 command.\n\n## Note\n\nYou might see some red text appears or warnings in the log. You can safely ignore this, because your project will still be deployed successfully.\n\n# Alternatives Deployment\n\nIf you prefer something else, please refer to create-react-app documentation [here](https://create-react-app.dev/docs/deployment#other-solutions).\n\n# More\n\nRead more about create-react-app [here](https://github.com/facebook/create-react-app)\n\nRead more about Zeit's Now.sh [here](https://zeit.co/now)\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"create-react-app-now\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"react-scripts\": \"0.9.5\",\n    \"serve\": \"^6.0.6\"\n  },\n  \"dependencies\": {\n    \"react\": \"^15.4.0\",\n    \"react-dom\": \"^15.4.0\",\n    \"react-router\": \"^4.0.0\",\n    \"react-router-dom\": \"^4.0.0\"\n  },\n  \"scripts\": {\n    \"now-start\": \"cd build && serve -s ./\",\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test --env=jsdom\",\n    \"eject\": \"react-scripts eject\",\n    \"deploy\": \"now -e REACT_APP_SECRET_CODE=secretcode\"\n  }\n}\n"
  },
  {
    "path": "public/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\">\n    <!--\n      Notice the use of %PUBLIC_URL% in the tag above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favico.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start`.\n      To create a production bundle, use `npm run build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "src/About.js",
    "content": "import React, { Component } from 'react';\nimport { Link } from 'react-router-dom';\n\nclass About extends Component {\n  render() {\n    return (\n      <div>About page here <Link to='/'>back</Link> | <Link to='/anything'>or Test Not Found Page</Link></div>\n    );\n  }\n}\n\nexport default About;\n"
  },
  {
    "path": "src/App.css",
    "content": ".App {\n  text-align: center;\n}\n\n.App-logo {\n  animation: App-logo-spin infinite 20s linear;\n  height: 80px;\n}\n\n.App-header {\n  background-color: #222;\n  height: 150px;\n  padding: 20px;\n  color: white;\n}\n\n.App-intro {\n  font-size: large;\n}\n\n@keyframes App-logo-spin {\n  from { transform: rotate(0deg); }\n  to { transform: rotate(360deg); }\n}\n"
  },
  {
    "path": "src/App.js",
    "content": "import React, { Component } from 'react';\nimport {\n  BrowserRouter as Router,\n  Route,\n  Link,\n  Switch,\n} from 'react-router-dom'\nimport About from './About';\nimport logo from './logo.svg';\nimport './App.css';\n\nconst NoMatch = ({ location }) => (\n  <div>\n    <p>No Match for <code>{location.pathname}</code></p>\n    <Link to='/'>go back</Link>\n  </div>\n)\n\nclass App extends Component {\n  render() {\n    const secretCode = process.env.REACT_APP_SECRET_CODE;\n    return (\n      <div className=\"App\">\n        <div className=\"App-header\">\n          <img src={logo} className=\"App-logo\" alt=\"logo\" />\n          <h2>Welcome to React</h2>\n        </div>\n        <p className=\"App-intro\">\n          To get started, edit <code>src/App.js</code> and save to reload.\n        </p>\n        <p>REACT_APP_SECRET_CODE: { !secretCode ? 'env not set yet' : secretCode }</p>\n        <p><Link to='/about'>about us</Link></p>\n      </div>\n    );\n  }\n}\n\nconst BasicApp = () => (\n  <Router>\n    <div>\n      <Switch>\n        <Route exact path=\"/\" component={App} />\n        <Route path=\"/about\" component={About} />\n        <Route component={NoMatch} />\n      </Switch>\n    </div>\n  </Router>\n)\n\nexport default BasicApp;\n"
  },
  {
    "path": "src/App.test.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', () => {\n  const div = document.createElement('div');\n  ReactDOM.render(<App />, div);\n});\n"
  },
  {
    "path": "src/index.css",
    "content": "body {\n  margin: 0;\n  padding: 0;\n  font-family: sans-serif;\n}\n"
  },
  {
    "path": "src/index.js",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport './index.css';\n\nReactDOM.render(\n  <App />,\n  document.getElementById('root')\n);\n"
  }
]