Fixes. TODO: autofocus on forms, and understand why email autofill in name field
[vchess.git] / server / app.js
index 4f9d167..eced7d3 100644 (file)
@@ -54,17 +54,13 @@ app.use(function(req, res, next) {
 
 // error handler
 app.use(function(err, req, res, next) {
-  // set locals, only providing error in development
-  res.locals.message = err.message;
-  res.locals.error = (req.app.get('env') === 'development' ? err : {});
-  // render the error page
   res.status(err.status || 500);
-  res.send(`
-    <!doctype html>
-    <h1>= message</h1>
-    <h2>= error.status</h2>
-    <pre>#{error.stack}</pre>
-  `);
+  if (app.get('env') === 'development')
+    console.log(err.stack);
+  res.send(
+    "<h1>" + err.message + "</h1>" +
+    "<h2>" + err.status + "</h2>"
+  );
 });
 
 module.exports = app;