Replaced nanoid with uniqid

This commit is contained in:
Nicolai Ort 2021-08-12 20:17:10 +02:00
parent 8ea9478a10
commit 68b9b43891
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 5 additions and 4 deletions

View File

@ -11,8 +11,8 @@
"dependencies": {
"fastify": "^3.20.1",
"knex": "^0.21.21",
"nanoid": "^3.1.25",
"sqlite3": "^5.0.2"
"sqlite3": "^5.0.2",
"uniqid": "^5.3.0"
},
"devDependencies": {
"nodemon": "^2.0.12"

View File

@ -1,5 +1,6 @@
const fastify = require('fastify')({ logger: true })
const { nanoid } = require('nanoid')
var uniqid = require('uniqid');
const knex = require('knex')({
client: 'sqlite3',
connection: {
@ -70,7 +71,7 @@ fastify.post('/new', { newUrlSchema }, async (req, res) => {
target
}
}
shortcode = nanoid(12);
shortcode = uniqid();
}
else {
const exists = await knex.select('shortcode')