Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM node:latest
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/

RUN mkdir -p /src/app

WORKDIR /src/app

COPY package.json /src/app/

RUN npm install
COPY . /usr/src/app
EXPOSE 4000
CMD [ “npm”, “start” ]

COPY . /src/app

EXPOSE 4000
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Make sure you have MongoDB and NodeJS installed on your system prior to start th
1. Install MongoDB community: https://www.mongodb.com/download-center/community
2. Install NodeJS: https://nodejs.org/en/download/

## Run & Test
1. Run `npm start` first to make sure your project is started succesfully
2. Run `npm test` to test everything

#Branches
The branch follows the same modules on Pluralsight at the end, therefore the Module-2 is the branch after the code for Module 2 has been completed.
15 changes: 0 additions & 15 deletions docker-compose.yml

This file was deleted.

8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import express from 'express';
import mongoose from 'mongoose';
import bodyParser from 'body-parser';

const app = express();
const PORT = 4000;

// mongoose connection
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/productsdb', {
useNewUrlParser: true,
useUnifiedTopology: true
});

// bodyparser setup
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
Expand Down
Loading