Skip to content

Commit 3d5b2f1

Browse files
committed
Update libraries and depdendies
1 parent c3e8534 commit 3d5b2f1

10 files changed

Lines changed: 3355 additions & 1751 deletions

File tree

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2017 Joe Biellik
3+
Copyright (c) 2015-2018 Joe Biellik
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
[![Release Version](https://img.shields.io/github/release/JoeBiellik/paste.svg)](https://github.com/JoeBiellik/paste/releases)
44
[![Dependencies](https://img.shields.io/david/JoeBiellik/paste.svg)](https://david-dm.org/JoeBiellik/paste)
55

6-
> Simple [Node.js](https://nodejs.org/) pastebin built with [Koa](http://koajs.com/), [MongoDB](https://www.mongodb.org/), [Jade](http://jade-lang.com/), [Bootstrap 4](http://v4-alpha.getbootstrap.com/) and [Prism.js](http://prismjs.com/).
6+
> Simple [Node.js](https://nodejs.org/) pastebin built with [Koa](https://koajs.com/), [MongoDB](https://www.mongodb.com/), [Jade](http://jade-lang.com/), [Bootstrap](https://getbootstrap.com/) and [Prism.js](https://prismjs.com/).
77
88
Try it out at [paste.fyi](http://paste.fyi/)
99

1010
## Features
11-
* Clean code thanks to ES7 async/await and [Koa v2](http://koajs.com/)
12-
* Full syntax highlighting via [Prism.js](http://prismjs.com/)
11+
* Clean code thanks to ES7 async/await and [Koa](https://koajs.com/)
12+
* Full syntax highlighting via [Prism.js](https://prismjs.com/)
1313
* <kbd>CTRL</kbd>+<kbd>Enter</kbd> hotkey for quick paste submission
1414
* Short URLs via [shortid](https://github.com/dylang/shortid), e.g. `NyQO9puMe`
15-
* Full support for CLI requests with [curl](http://curl.haxx.se/) etc
15+
* Full support for CLI requests with [curl](https://curl.haxx.se/) etc
1616
* Textarea grows to fit content via [autosize.js](https://github.com/jackmoore/autosize)
1717
* Automatic and configurable paste expiry
1818
* Runs fully containerized with [Docker](https://www.docker.com/) and [Vagrant](https://www.vagrantup.com/)
19-
* Simple and responsive UI built with [Bootstrap 4](http://v4-alpha.getbootstrap.com/)
19+
* Simple and responsive UI built with [Bootstrap](https://getbootstrap.com/)
2020

2121
## Usage
2222
```sh

controllers/pastes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
ctx.body = paste.paste;
2020
}
2121
} catch (ex) {
22-
ctx.throw('Paste Not Found', 404);
22+
ctx.throw(404, 'Paste Not Found');
2323
}
2424
},
2525

db.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ module.exports = () => {
88
mongoose.connection.once('open', util.log.bind(util, 'MongoDB connection open'));
99
mongoose.connection.on('error', console.error.bind(console, 'MongoDB connection error:'));
1010

11+
mongoose.set('useCreateIndex', true);
12+
1113
mongoose.connect(config.db, {
12-
useMongoClient: true
14+
useNewUrlParser: true
1315
});
1416

1517
return mongoose.connection;

models/paste.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const mongoose = require('mongoose');
22
const shortid = require('shortid');
33

44
const paste = new mongoose.Schema({
5-
_id: { type: String, unique: true, default: shortid.generate },
5+
_id: { type: String, default: shortid.generate },
66
paste: { type: String },
77
expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) }
88
}, {

0 commit comments

Comments
 (0)