官术网_书友最值得收藏!

Running the application on the development machine

Follow these steps to download the source code from GitHub and configure it to work on your development machine:

  1. Clone the repository in your development space:
$ git clone https://github.com/legorie/gcpcookbook.git 
  1. Navigate to the directory where the mysite application is stored:
$ cd gcpcookbook/Chapter01/mysite
  1. With your favorite editor, create a filename .env in the mysite folder:
COOKIE_SECRET=d44d5c45e7f8149aabc068244 
MONGO_URI=mongodb://localhost/mysite 
  1. Install all the packages required for the application to work:
$ npm install 
  1. Start the mongod service in your development machine
  2. Run the application:
$ node keystone.js 
  1. You'll see the following message logged on the Terminal:
------------------------------------------------
Applying update 0.0.1-admins...

------------------------------------------------
mySite: Successfully applied update 0.0.1-admins.

Successfully created:

* 1 User


------------------------------------------------
Successfully applied 1 update.
------------------------------------------------

------------------------------------------------
KeystoneJS Started:
mySite is ready on port 3000
------------------------------------------------
  1. The application is now available on http://localhost:3000, as shown:
  1.  You can stop the local server by pressing Ctrl + C.
主站蜘蛛池模板: 仙游县| 乌海市| 西宁市| 花垣县| 东丰县| 桐城市| 桃源县| 诏安县| 马鞍山市| 文化| 房山区| 康定县| 谷城县| 鄂温| 新龙县| 收藏| 新巴尔虎右旗| 黔东| 闸北区| 雅安市| 宽城| 高碑店市| 金门县| 通城县| 乳源| 汾西县| 房山区| 介休市| 洪泽县| 星子县| 监利县| 资兴市| 莱西市| 十堰市| 郎溪县| 呼和浩特市| 象山县| 张家界市| 禹城市| 全椒县| 金寨县|