Live Example: static-example.now.sh
This example shows a project which is deployed with ZEIT Now.
This project consists of static files (
js/timeago.js) which make up a simple static website that shows 5 of the latest Hacker News posts.
ZEIT Now also provides default routing for
index files as the root of a path. In this case,
index.html exists at the base of the project and so is served as the
/ root path.
index.html file also links to
js/timeago.js which are all deployed as static files with Now, since no
builds property exists in this example.
Last, but not least, the
now.json file acts as an instructional configuration file for Now that helps define how your deployment should be built and served.
In this project, the
now.json file only contains two properties:
version, which tells Now which platform version you wish to deploy and serve content with.
name, which defines a project name for all deployments using this codebase to be sorted under.
For more information on configuring your projects with Now, read the Deployment Configuration documentation.
Deploying This Project with ZEIT Now
With Now CLI, you can initialise this project on your system with the following command in your terminal:
now init static
This command will create a
static directory in your current working directory.
Moving into this directory (with
cd static), you can then deploy the project with the following command:
For more information on how you can deploy your own static project, or any other project, see the following resources: