| adding slightly better error page - seedlinux - Torrent indexing tool opensourc… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 50ff6fab0f3366b87c404e547ab4cdf27e2b8f13 | |
| parent eb3de87dffff4a455f5e8b1159add8eb1280d222 | |
| Author: Jay Scott <[email protected]> | |
| Date: Sat, 1 Jul 2017 11:42:45 +0100 | |
| adding slightly better error page | |
| Diffstat: | |
| D app/db.js | 14 -------------- | |
| M routes/index.js | 6 ++---- | |
| M views/error.pug | 21 +++++++++++++++------ | |
| 3 files changed, 17 insertions(+), 24 deletions(-) | |
| --- | |
| diff --git a/app/db.js b/app/db.js | |
| @@ -1,13 +0,0 @@ | |
| -'use strict'; | |
| - | |
| -const mongoose = require('mongoose'); | |
| - | |
| -const mongoDB = config.dbURI; | |
| -mongoose.connect(mongoDB); | |
| - | |
| -var db = mongoose.connection; | |
| -db.on('error', console.error.bind(console, 'MongoDB connection error:')); | |
| - | |
| -module.exports = { | |
| - db | |
| -} | |
| -\ No newline at end of file | |
| diff --git a/routes/index.js b/routes/index.js | |
| @@ -2,10 +2,8 @@ | |
| const express = require('express'); | |
| const router = express.Router(); | |
| +const torrent_controller = require('../controllers/torrents_controller'); | |
| -/* Redirect home page to torrents list. */ | |
| -router.get('/', function(req, res) { | |
| - res.redirect('/torrent'); | |
| -}); | |
| +router.get('/', torrent_controller.index); | |
| module.exports = router; | |
| diff --git a/views/error.pug b/views/error.pug | |
| @@ -1,6 +1,15 @@ | |
| -extends layout | |
| - | |
| -block content | |
| - h1= message | |
| - h2= error.status | |
| - pre #{error.stack} | |
| +doctype html | |
| +html | |
| + head | |
| + meta(charset='utf-8') | |
| + meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") | |
| + meta(name='viewport', content='width=device-width, initial-scale=1.0') | |
| + title= title | |
| + link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/semant… | |
| + link(rel='stylesheet', href='/stylesheets/style.css') | |
| + body | |
| + .ui.container | |
| + h2.ui.center.aligned.icon.header | |
| + i.frown.icon | |
| + .content | |
| + .sub.header= "Whoops! I think you are lost!" |