Hidden Perspectives Microsite
Microsite code for Hidden Perspectives
npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main.<hash>.js are served with the contents of the /static/js/main.<hash>.js file.
For environments using Node, the easiest way to handle this would be to install serve and let it handle the rest:
npm install -g serve
serve -s buildThe last command shown above will serve your static site on the port 5000. Like many of serve’s internal settings, the port can be adjusted using the -p or --port flags.
Run this command to get a full list of the options available:
serve -hTo do a manual deploy to Netlify’s CDN:
npm install netlify-cli -g
netlify deployChoose build as the path to deploy.
To setup continuous delivery:
With this setup Netlify will build and deploy when you push to git or open a pull request:
- Start a new netlify project
- Pick your Git hosting service and select your repository
- Click
Build your site
Support for client-side routing:
To support pushState, make sure to create a public/_redirects file with the following rewrite rules:
/* /index.html 200
When you build the project, Create React App will place the public folder contents into the build output.
Now offers a zero-configuration single-command deployment. You can use now to deploy your app for free.
-
Install the
nowcommand-line tool either via the recommended desktop tool or via node withnpm install -g now. -
Build and export your app by running
npm run export. -
Move into the build directory by running
cd out. -
Run
now --name your-project-namefrom within the build directory. You will see a now.sh URL in your output like this:> Ready! https://your-project-name-tpspyhtdtk.now.sh (copied to clipboard)Paste that URL into your browser when the build is complete, and you will see your deployed app.
Details are available in this article.