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

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.
主站蜘蛛池模板: 南投县| 大荔县| 龙陵县| 成武县| 田东县| 成武县| 河津市| 万荣县| 福海县| 余庆县| 古田县| 永宁县| 双牌县| 鹤庆县| 渭南市| 河源市| 阳江市| 肥乡县| 鄂托克前旗| 习水县| 微博| 通州市| 鄂托克旗| 西乡县| 上高县| 仁化县| 徐闻县| 名山县| 崇礼县| 蕉岭县| 云阳县| 长泰县| 饶平县| 汶上县| 浦城县| 鄂托克前旗| 东宁县| 明光市| 漳浦县| 蓬安县| 吴忠市|