README.md 720 字节
Newer Older
D
Dan Zajdband 已提交
1 2 3 4 5 6 7 8

# Hello World example

## How to use

Download the example:

```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 13 14 15
```

or clone the repo:

```bash
N
nkzawa 已提交
16
git clone https://github.com/zeit/next.js.git --depth=1
D
Dan Zajdband 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
cd next.js/examples/hello-world
```

Install the dependencies:

```bash
npm install
```

Run the dev server:

```bash
npm run dev
```

## 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.