Skip to content

Commit 69d40d1

Browse files
committed
Merge pull request #2824 from zpao/docs-tutorial-server
[docs] Talk about running a server in tutorial
2 parents 1428ea7 + 8babd0a commit 69d40d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/docs/tutorial.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ It'll also have a few neat features:
2323

2424
[It's all on GitHub.](https://github.com/reactjs/react-tutorial)
2525

26+
### Running a server
27+
28+
While it's not necessary to get started with this tutorial, later on we'll be adding functionality that requires `POST`ing to a running server. If this is something you are intimately familiar with and want to create your own server, please do. For the rest of you who might want to focus on learning about React without having to worry about the server-side aspects, we have written simple servers in a number of languages - JavaScript (using Node.js), Python, and Ruby. These are all available on GitHub. You can [view the source](https://github.com/reactjs/react-tutorial/) or [download a zip file](https://github.com/reactjs/react-tutorial/archive/master.zip) to get started.
29+
30+
To get started using the tutorial download, just start editing `public/index.html`.
31+
2632
### Getting started
2733

2834
For this tutorial, we'll use prebuilt JavaScript files on a CDN. Open up your favorite editor and create a new HTML document:
2935

3036
```html
31-
<!-- template.html -->
37+
<!-- index.html -->
3238
<html>
3339
<head>
3440
<title>Hello React</title>
@@ -209,7 +215,7 @@ Markdown is a simple way to format your text inline. For example, surrounding te
209215
First, add the third-party **Showdown** library to your application. This is a JavaScript library which takes Markdown text and converts it to raw HTML. This requires a script tag in your head (which we have already included in the React playground):
210216

211217
```html{7}
212-
<!-- template.html -->
218+
<!-- index.html -->
213219
<head>
214220
<title>Hello React</title>
215221
<script src="http://fb.me/react-{{site.react_version}}.js"></script>
@@ -379,7 +385,7 @@ When the component is first created, we want to GET some JSON from the server an
379385

380386
We'll use jQuery to help make an asynchronous request to the server.
381387

382-
Note: because this is becoming an AJAX application you'll need to develop your app using a web server rather than as a file sitting on your file system. The easiest way to do this is to run `python -m SimpleHTTPServer` in your application's directory.
388+
Note: because this is becoming an AJAX application you'll need to develop your app using a web server rather than as a file sitting on your file system. [As mentioned above](#running-a-server), we have provided serveral servers you can use [on GitHub](https://github.com/reactjs/react-tutorial/). They provide the functionality you need for the rest of this tutorial.
383389

384390
```javascript{6-17}
385391
// tutorial13.js

0 commit comments

Comments
 (0)