- Google Cloud Platform Cookbook
- Legorie Rajan PS
- 155字
- 2021-08-27 19:13:23
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:
- Clone the repository in your development space:
$ git clone https://github.com/legorie/gcpcookbook.git
You can also download the code from: https://github.com/PacktPublishing/Google-Cloud-Platform-Cookbook.
- Navigate to the directory where the mysite application is stored:
$ cd gcpcookbook/Chapter01/mysite
- With your favorite editor, create a filename .env in the mysite folder:
COOKIE_SECRET=d44d5c45e7f8149aabc068244 MONGO_URI=mongodb://localhost/mysite
- Install all the packages required for the application to work:
$ npm install
- Start the mongod service in your development machine
- Run the application:
$ node keystone.js
------------------------------------------------
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
------------------------------------------------
- The application is now available on http://localhost:3000, as shown:

- You can stop the local server by pressing Ctrl + C.