This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
network:webdev:gatsby [2021/07/18 10:18] zhwiki |
network:webdev:gatsby [2021/07/18 22:38] (current) zhwiki [创建网站] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== 设置开发环境 ===== | ===== 设置开发环境 ===== | ||
- | Installation Guide | + | Gatsby开发环境需要以下工具: |
- | + | ||
- | The rest of this part of the Tutorial walks you through how to install the following tools: | + | |
1. Node.js (v12.13 or newer),其中包括npm包管理工具。 | 1. Node.js (v12.13 or newer),其中包括npm包管理工具。 | ||
Line 27: | Line 25: | ||
| | ||
4.编辑器,如Visual Studio Code | 4.编辑器,如Visual Studio Code | ||
+ | |||
+ | ===== 创建网站 ===== | ||
+ | |||
+ | 1. 创建网站,运行gatsby命令行工具: | ||
+ | |||
+ | gatsby new | ||
+ | | ||
+ | 进入交互模式,创建网站。 | ||
+ | | ||
+ | 2. 编译网站,进入网站目录,运行编译工具,在本地编译网站: | ||
+ | |||
+ | npm run develop | ||
+ | | ||
+ | 3. 编译完成后,运行本地服务器: | ||
+ | |||
+ | gatsby develop | ||
+ | |||
+ | 此时,就可以在浏览器查看网站: | ||
+ | |||
+ | http://localhost:8000/ | ||
+ | |||
+ | 查看GraphiQL: | ||
+ | |||
+ | http://localhost:8000/___graphql | ||
+ | |||