Skip to content

Commit

Permalink
update for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Lavish883 authored Jan 9, 2024
1 parent 4fd63f3 commit 6bffde9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ mongoose.set('strictQuery', false);
mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true })

// set up the server
if (process.env.PRODUCTION){
app.set('trust proxy', 1);
}
app.set('view engine', 'pug');
app.use(express.static('public'))
// max size of the file is 5mb
Expand Down Expand Up @@ -80,6 +83,7 @@ app.post('/test/saveLogoImage', rateLimiter, createFormFuctions.saveLogoImage);
app.post('/formMaker/sendCodeEmail', rateLimiter ,createFormFuctions.sendCodeEmail);
app.post('/formMaker/confirmEmailWithCode', rateLimiter, createFormFuctions.confirmEmailWithCode);
app.post('/formMaker/passwordReset', rateLimiter, createFormFuctions.passwordReset);
app.get('/ip', (request, response) => response.send(request.ip))

// api routes
app.post('/api/addUsertoFormMaker', [rateLimiter, apiFunctions.checkAPI_KEY], apiFunctions.addUsertoFormMaker);
Expand Down

0 comments on commit 6bffde9

Please sign in to comment.