diff --git a/Dockerfile b/Dockerfile index 091d0b4..e8fbc9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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) diff --git a/prevue-prod.zip b/prevue-prod.zip new file mode 100644 index 0000000..020b68d Binary files /dev/null and b/prevue-prod.zip differ diff --git a/server/controllers/oAuthController.js b/server/controllers/oAuthController.js index 11d5520..51fefc1 100644 --- a/server/controllers/oAuthController.js +++ b/server/controllers/oAuthController.js @@ -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(); diff --git a/server/server.js b/server/server.js index 790d0ed..6871c90 100644 --- a/server/server.js +++ b/server/server.js @@ -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'); @@ -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()); @@ -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);