Skip to content

Commit ba34f82

Browse files
cubapthehabes
andauthored
remove render engine (#184)
* remove render engine fixes #172 pruned package-lock result * undiff these --------- Co-authored-by: Bryan Haberberger <bryan.j.haberberger@slu.edu>
1 parent 3c44130 commit ba34f82

File tree

6 files changed

+3
-28
lines changed

6 files changed

+3
-28
lines changed

app.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
import createError from 'http-errors'
43
import express from 'express'
54
import path from 'path'
65
import cookieParser from 'cookie-parser'
@@ -20,10 +19,6 @@ const __dirname = path.dirname(__filename)
2019

2120
const app = express()
2221

23-
// view engine setup
24-
app.set('views', path.join(__dirname, 'views'))
25-
app.set('view engine', 'ejs')
26-
2722
//Middleware to use
2823

2924
/**
@@ -76,7 +71,7 @@ app.use(express.static(path.join(__dirname, 'public')))
7671
*/
7772
app.all('*', (req, res, next) => {
7873
if(process.env.DOWN === "true"){
79-
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We aplologize for the inconvenience. Try again later."})
74+
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We apologize for the inconvenience. Try again later."})
8075
}
8176
else{
8277
next() //pass on to the next app.use

bin/rerum_v1.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ function onError(error) {
5656
case 'EACCES':
5757
console.error(bind + ' requires elevated privileges')
5858
process.exit(1)
59-
break
6059
case 'EADDRINUSE':
6160
console.error(bind + ' is already in use')
6261
process.exit(1)
63-
break
6462
default:
6563
throw error
6664
}

rest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* 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
1818
* 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
1919
*
20-
* The error handler sits a level up, so do not res.send() or res.render here. Just give back a boolean
20+
* The error handler sits a level up, so do not res.send() here. Just give back a boolean
2121
*/
2222
const checkPatchOverrideSupport = function (req, res) {
2323
const override = req.header("X-HTTP-Method-Override")

routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const router = express.Router()
33

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

99
export default router

views/error.ejs

Lines changed: 0 additions & 3 deletions
This file was deleted.

views/index.ejs

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)