Skip to content

Commit b155f1e

Browse files
committed
default to 8080
1 parent dc9e703 commit b155f1e

File tree

4 files changed

+30
-50
lines changed

4 files changed

+30
-50
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
ReadME-Images

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ MONGODB_URL=
66

77
# Certificate - needed for connecting to IBM Cloud Databases for MongoDB
88
CERTIFICATE_BASE64=
9-
PORT=6020
9+
PORT=8080
1010
BIND=0.0.0.0

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:8
1+
FROM node:14
22

33
# Create app directory
44
RUN mkdir /src
@@ -19,6 +19,6 @@ COPY ./public /src/public
1919
COPY ./server.js /src/server.js
2020
COPY ./.env /src/.env
2121

22-
23-
EXPOSE 6020
22+
ENV PORT 8080
23+
EXPOSE 8080
2424
CMD [ "npm", "start" ]

README.md

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The code and detailed steps are discussed in the [IBM Cloud solution tutorial](h
1313
- Create, edit and delete user accounts
1414
- Authentication with username/password
1515
- Protected routes that can only be accessed by authenticated users
16-
- Bootstrap CSS framework & [Cosmo theme](https://bootswatch.com/cosmo/)
16+
- Bootstrap CSS framework
1717
- HTTPS built-in if deployed to [IBM Cloud](#deploy-to-ibm-cloud)
1818
- [Mongoose](https://github.com/Automattic/mongoose) for MongoDB interactions.
1919
- [PassportJS](http://passportjs.org) for authentication, with over 300 authentication strategies to pick from.
@@ -23,8 +23,28 @@ The code and detailed steps are discussed in the [IBM Cloud solution tutorial](h
2323
- [IBM Cloud Databases for MongoDB](https://cloud.ibm.com/catalog/services/databases-for-mongodb)
2424
- [Cloud Foundry Command Line Tool](https://docs.cloudfoundry.org/devguide/installcf/)
2525

26-
## Getting Started
27-
##### Run the application locally
26+
## Files & Folders
27+
28+
| File | Description |
29+
| ---------------------------------- | ------------------------------------------------------------ |
30+
| [**manifest.yml**](./manifest.yml) | File that defines deployment paramaters. [More info here](http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html)
31+
| [**.env.example**](./.env.example) | Set custom [environment variables](https://en.wikipedia.org/wiki/Environment_variable) for your application. This is the proper way to store credentials and other sensitive values.
32+
| [**server.js**](./server.js) | Main server file that the Node.js runtime uses. It contains all the server logic.
33+
| [**/server**](./server) | Folder for files used by the Node.js server
34+
| [/server/models/**user.model.js**](./server/models/user.model.js) | Model for storing users in MongoDB
35+
| [**/public**](./public) | Folder for files delivered to users, such as html and css files
36+
| [/public/js/**app.js**](./public/js/app.js) | Angular application for manipulating and rendering data in browser
37+
38+
## Application
39+
- **MongoDB** stores user account information and persists sessions (so that a server crash does not log out all users.)
40+
- **Express** functions Node.js middleware to handle all HTTP requests and routing.
41+
- **Angular** handles HTML templating and data manipulation.
42+
- **Node.js** is the runtime for the application.
43+
44+
There is also generous commenting throughout the application which helps explain critical parts of the application.
45+
46+
## Running locally
47+
2848
1. Clone or download this repo onto your machine.
2949
1. Install [application requirements](#application-requirements) if not done so already.
3050
1. Open application directory in your terminal and run `npm install`
@@ -45,51 +65,9 @@ An alternative way of running locally is using the provided `Dockerfile`.
4565
```
4666
- Run the app locally
4767
```
48-
docker run -p 6020:6020 -ti mean-stack:v1.0.0
68+
docker run -p 8080:8080 -ti mean-stack:v1.0.0
4969
```
5070

51-
##### Deploy to IBM Cloud
52-
53-
Option 1 (launch this app directly from this repo):
54-
55-
[![Deploy to IBM Cloud](https://cloud.ibm.com/devops/setup/deploy/button.png)](https://cloud.ibm.com/devops/setup/deploy?repository=https://github.com/IBM-Cloud/nodejs-MEAN-stack)
56-
57-
Option 2 (deploy from your local machine):
58-
59-
1. Clone or download this repo onto your machine.
60-
2. Open a terminal prompt to the directory of your application.
61-
3. If you don't have an account, [create a free one here](https://cloud.ibm.com).
62-
4. Login to your account via the command line: `ibmcloud login`
63-
5. Target your account ORG and SPACE `ibmcloud target --cf`
64-
6. Create the instance of IBM Cloud Databases for MongoDB on IBM Cloud: `ibmcloud cf create-service databases-for-mongodb standard mean-starter-mongodb`
65-
7. Push your app to IBM Cloud with `ibmcloud cf push`
66-
8. Done, the app should be looking like:<img src="ReadME-Images/live-app.png">
67-
68-
#### Problems or Questions?
69-
70-
Create a [GitHub issue](https://github.com/IBM-Cloud/nodejs-MEAN-stack/issues/new) for questions or problems occurs using this demo.
71-
72-
## Critical Files & Folders
73-
74-
| File | Description |
75-
| ---------------------------------- | ------------------------------------------------------------ |
76-
| [**manifest.yml**](./manifest.yml) | File that defines deployment paramaters. [More info here](http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html)
77-
| [**.env.example**](./.env.example) | Set custom [environment variables](https://en.wikipedia.org/wiki/Environment_variable) for your application. This is the proper way to store credentials and other sensitive values.
78-
| [**server.js**](./server.js) | Main server file that the Node.js runtime uses. It contains all the server logic.
79-
| [**/server**](./server) | Folder for files used by the Node.js server
80-
| [/server/models/**user.model.js**](./server/models/user.model.js) | Model for storing users in MongoDB
81-
| [**/public**](./public) | Folder for files delivered to users, such as html and css files
82-
| [/public/js/**app.js**](./public/js/app.js) | Angular application for manipulating and rendering data in browser
83-
84-
85-
## Application
86-
- **MongoDB** stores user account information and persists sessions (so that a server crash does not log out all users.)
87-
- **Express** functions Node.js middleware to handle all HTTP requests and routing.
88-
- **Angular** handles HTML templating and data manipulation.
89-
- **Node.js** is the runtime for the application.
90-
91-
There is also generous commenting throughout the application which helps explain critical parts of the application.
92-
9371
## Contribute
9472
Please create a pull request with your desired changes.
9573

0 commit comments

Comments
 (0)