Skip to content
Merged
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
7 changes: 1 addition & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

import createError from 'http-errors'
import express from 'express'
import path from 'path'
import cookieParser from 'cookie-parser'
Expand All @@ -20,10 +19,6 @@ const __dirname = path.dirname(__filename)

const app = express()

// view engine setup
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')

//Middleware to use

/**
Expand Down Expand Up @@ -76,7 +71,7 @@ app.use(express.static(path.join(__dirname, 'public')))
*/
app.all('*', (req, res, next) => {
if(process.env.DOWN === "true"){
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We aplologize for the inconvenience. Try again later."})
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We apologize for the inconvenience. Try again later."})
}
else{
next() //pass on to the next app.use
Expand Down
2 changes: 0 additions & 2 deletions bin/rerum_v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ function onError(error) {
case 'EACCES':
console.error(bind + ' requires elevated privileges')
process.exit(1)
break
case 'EADDRINUSE':
console.error(bind + ' is already in use')
process.exit(1)
break
default:
throw error
}
Expand Down
2 changes: 1 addition & 1 deletion rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* X-HTTP-Method-Override header is present, !== PATCH means "no", you have done a POST and are not emulating it as a PATCH, so 405
* X-HTTP-Method-Override header is present, == PATCH, and method request is POST means "yes", you are emulating a POST as a PATCH, correct method 200
*
* The error handler sits a level up, so do not res.send() or res.render here. Just give back a boolean
* The error handler sits a level up, so do not res.send() here. Just give back a boolean
*/
const checkPatchOverrideSupport = function (req, res) {
const override = req.header("X-HTTP-Method-Override")
Expand Down
2 changes: 1 addition & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const router = express.Router()

/* GET home page. */
router.get('/', (req, res, next) => {
res.render('index', { title: 'RERUM' })
res.sendFile('index.html', { root: 'public' })
})

export default router
3 changes: 0 additions & 3 deletions views/error.ejs

This file was deleted.

15 changes: 0 additions & 15 deletions views/index.ejs

This file was deleted.