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

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.
主站蜘蛛池模板: 尚义县| 富蕴县| 和平县| 固安县| 南江县| 永川市| 怀宁县| 元朗区| 华容县| 原平市| 扎囊县| 嘉兴市| 西和县| 永定县| 玛沁县| 潜江市| 佛教| 盐津县| 建平县| 贵阳市| 玉树县| 金湖县| 德昌县| 眉山市| 洛浦县| 隆尧县| 常州市| 淅川县| 罗江县| 琼结县| 大厂| 屯门区| 涪陵区| 枣庄市| 称多县| 齐河县| 新干县| 平和县| 大安市| 阿合奇县| 抚顺县|