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

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.
主站蜘蛛池模板: 江源县| 稷山县| 于都县| 贞丰县| 搜索| 西贡区| 新绛县| 大洼县| 泽州县| 宜川县| 鄂托克前旗| 合阳县| 太白县| 景德镇市| 太仆寺旗| 奇台县| 邹城市| 藁城市| 连平县| 靖州| 海南省| 建昌县| 蓬安县| 家居| 桃源县| 宾川县| 阜宁县| 连州市| 邵阳市| 天峻县| 嘉峪关市| 堆龙德庆县| 陵川县| 兴城市| 依安县| 汾西县| 安吉县| 锡林浩特市| 海淀区| 綦江县| 沙坪坝区|