seedlinux

find open source torrents and stats for people wishing to contribute bandwidth.
git clone git://git.beardyjay.co.uk/seedlinux
Log | Files | Refs | README | LICENSE

commit 9f0c6bcecc14006a8a6179a2085fcde1a5df53f0
parent 9acf79798e0084669c50e49962199912288321e5
Author: Jay Scott <jay@jayscott.co.uk>
Date:   Sat,  1 Jul 2017 11:42:45 +0100

adding slightly better error page

Diffstat:
Dapp/db.js | 14--------------
Mroutes/index.js | 6++----
Mviews/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/semantic-ui/2.2.10/semantic.min.css') + 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!"