README.md 728 字节
Newer Older
D
Dan Zajdband 已提交
1 2 3 4 5

# Hello World example

## How to use

D
Dan Zajdband 已提交
6
Download the example (or clone the repo)[https://github.com/zeit/next.js.git]:
D
Dan Zajdband 已提交
7 8

```bash
N
nkzawa 已提交
9 10
curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/hello-world
cd hello-world
D
Dan Zajdband 已提交
11 12
```

D
Dan Zajdband 已提交
13
Install it and run:
D
Dan Zajdband 已提交
14 15 16

```bash
npm install
D
Dan Zajdband 已提交
17
npm run dev
D
Dan Zajdband 已提交
18 19
```

D
Dan Zajdband 已提交
20
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
D
Dan Zajdband 已提交
21 22

```bash
D
Dan Zajdband 已提交
23
now
D
Dan Zajdband 已提交
24 25 26 27 28
```

## The idea behind the example

This example shows the most basic idea behind Next. We have 2 pages: `pages/index.js` and `pages/about.js`. The former responds to `/` requests and the latter to `/about`. Using `next/link` you can add hyperlinks between them with universal routing capabilities.