Skip to content
Merged

Dev #30

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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# base image that provides runtime environment for the application
FROM node:16.18
FROM node:16.13
# where the application code will be copied to in the docker container
WORKDIR /usr/src/app
# copies all files from the current directory (where the Dockerfile is located) to the working directory in the docker image (which we set on line 4)
Expand Down
Binary file added prevue-prod.zip
Binary file not shown.
3 changes: 1 addition & 2 deletions server/controllers/oAuthController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const oAuthController = {};
const GITHUB_OAUTH_CLIENT_ID = process.env.GITHUB_OAUTH_CLIENT_ID;
const GITHUB_OAUTH_CLIENT_SECRET = process.env.GITHUB_OAUTH_CLIENT_SECRET;
const GITHUB_ACCESS_TOKEN_REQUEST_URL = `https://github.com/login/oauth/access_token`;
const GITHUB_REDIRECT_URI =
'http://localhost:8080/users/oauth/access_token/redirect';
const GITHUB_REDIRECT_URI = process.env.GITHUB_REDIRECT_URI;
let str = GITHUB_OAUTH_CLIENT_ID.toString();
let newStr = GITHUB_REDIRECT_URI.toString();

Expand Down
10 changes: 5 additions & 5 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const PORT = 8080;

const cors = require('cors');
const corsOptions = {
origin: 'http://localhost:8080',
origin: process.env.CORS_ORIGIN,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
credentials: true
credentials: true,
};
const accountRouter = require('./routes/accountRouter');
const projectRouter = require('./routes/projectRouter');
Expand All @@ -23,10 +23,10 @@ mongoose
useNewUrlParser: true,
useUnifiedTopology: true,
// sets the name of the DB that our collections are part of
dbName: 'prevueDB'
dbName: 'prevueDB',
})
.then(() => console.log('Connected to Mongo DB.'))
.catch(err => console.log(err));
.catch((err) => console.log(err));

// Global Middleware
app.use(express.json());
Expand All @@ -51,7 +51,7 @@ app.use((err, req, res, next) => {
const defaultErr = {
log: 'Express error handler caught unknown middleware error',
status: 400,
message: { err: 'An error occurred' }
message: { err: 'An error occurred' },
};
const errorObj = Object.assign({}, defaultErr, err);
console.log(errorObj.log);
Expand Down