You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,18 +22,29 @@ This application uses the [IBM Cloud Databases for MongoDB service](https://clou
22
22
-[Cloud Foundry Command Line Tool](https://docs.cloudfoundry.org/devguide/installcf/)
23
23
24
24
## Getting Started
25
-
##### Local Application Development
25
+
##### Run the application locally
26
26
1. Clone or download this repo onto your machine.
27
-
2. Install [application requirements](#application-requirements) if not done so already.
28
-
3. Open application directory in your terminal and run `npm install`
29
-
4. Rename `.env.example` file to `.env`. Edit the contents as needed, at a minimum adding your own SESSION_SECRET.
30
-
5. Start up your local MongoDB server (typically just `mongod`, see docs [here](https://docs.mongodb.org/getting-started/shell/installation/))
31
-
6. Run `node server.js` to start your app
32
-
7. Open a browser to the link provided in the terminal prompt to view your app
33
-
34
-
Note that the code assumes a secured connection to MongoDB using SSL and a certificate. This way you can run the app locally but connect to IBM Cloud Databases for MongoDB.
35
-
36
-
An alternative way of local development is using the provided Dockerfile.
27
+
1. Install [application requirements](#application-requirements) if not done so already.
28
+
1. Open application directory in your terminal and run `npm install`
29
+
1. If you don't have an account, [create a free one here](https://cloud.ibm.com).
30
+
1. Login to your account via the command line: `ibmcloud login`
31
+
1. Target your account ORG and SPACE `ibmcloud target --cf`
32
+
1. Create the instance of Compose for MongoDB on IBM Cloud: `ibmcloud cf create-service databases-for-mongodb standard mean-starter-mongodb`
33
+
1. Rename `.env.example` file to `.env` and run `ibmcloud cf service-key mean-starter-mongodb "Service credentials-1"` for MONGODB_URL and CERTIFICATE_BASE64. Choose your own SESSION_SECRET.
34
+
1. Run `node server.js` to start your app
35
+
1. Open a browser to the link provided in the terminal prompt to view your app
36
+
37
+
> Note that the code assumes a secured connection to MongoDB using SSL and a certificate. This way you can run the app locally but connect to IBM Cloud Databases for MongoDB.
38
+
39
+
An alternative way of running locally is using the provided `Dockerfile`.
40
+
- Install docker on your machine and build the docker image
41
+
```
42
+
docker build . -t mean-stack:v1.0.0
43
+
```
44
+
- Run the app locally
45
+
```
46
+
docker run -p 6020:6020 -ti mean-stack:v1.0.0
47
+
```
37
48
38
49
##### Deploy to IBM Cloud
39
50
@@ -52,11 +63,9 @@ Option 2 (deploy from your local machine):
52
63
7. Push your app to IBM Cloud with `ibmcloud cf push`
53
64
8. Done, the app should be looking like:<imgsrc="ReadME-Images/live-app.png">
54
65
55
-
56
-
57
66
#### Problems or Questions?
58
67
59
-
Create a [GitHub issue](https://github.com/IBM-Cloud/nodejs-MEAN-stack/issues/new) for questions or problems occurs using this demo.
68
+
Create a [GitHub issue](https://github.com/IBM-Cloud/nodejs-MEAN-stack/issues/new) for questions or problems occurs using this demo.
0 commit comments