Create a Custom URL Shortener using Node.JS and MongoDB

Create a Custom URL Shortener using Node.JS and MongoDB

Piyush Garg

1 год назад

93,340 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Viral shorts 2.0
Viral shorts 2.0 - 06.11.2023 21:27

TypeError: Cannot read properties of null (reading 'redirectURL') , Anyone please help how to resolve it.

Ответить
Rayan Ahmad
Rayan Ahmad - 03.11.2023 21:12

Interesting video, nice explanation Thanks

Ответить
DHRUV
DHRUV - 03.11.2023 06:15

FOR THOSE WHO ARE STUCK AT entry.redirect not defined, try
entry["redirectURL"].... idk why but it works and that dont bruh.

Ответить
Vivek
Vivek - 30.10.2023 12:11

Path is required like error can be solved by defining default:shortid() , in shortId: Schema

shortId: {
type:String,
unique: true,
default: shortid(),
required: true,
},

Ответить
shivanshu singh
shivanshu singh - 27.10.2023 17:20

bhai I follow your same code and when i start npm the npm is running also but when i run send url from post man it always saying url is required please helpm me out

Ответить
Sachinandan Prasad
Sachinandan Prasad - 17.10.2023 11:27

Help Please,
Cannot GET /analytics/0AOgMEv

Ответить
Dev_Ops Enginner
Dev_Ops Enginner - 06.10.2023 17:19

make a video on mongodb module in Nodejs

Ответить
Yashi Gupta
Yashi Gupta - 01.10.2023 23:41

Code is not working

Ответить
Nitya Ranjan
Nitya Ranjan - 18.09.2023 12:50

Got the solution for typeError: Cannot read properties of null (reading 'redirectURL') . You should add {shortid:shortId} as a json as 1st parameter in findOneAndUpdate() method instead of only {shortId} . Then it should work.

Ответить
Nitya Ranjan
Nitya Ranjan - 18.09.2023 12:31

TypeError: Cannot read properties of null (reading 'redirectURL') , Anyone please help how to resolve it.

Ответить
Shorten World Platform
Shorten World Platform - 11.09.2023 12:55

Thank you for your great efforts! Really really awesome video.

Ответить
Krish Jain
Krish Jain - 20.08.2023 21:57

For those its not working because shortid has been depretiated. and if you still want to use it then install it by "npm i [email protected]". hopefully it would work.

Ответить
Roshan Nayak
Roshan Nayak - 16.08.2023 19:28

getting error on postman get request "Cannot GET /url/8iN0AH5hG" also used yr source code but still getting issue how to fix can u help ?

Ответить
Rohan patil
Rohan patil - 08.08.2023 09:28

Jitne bhi logo ko error aa raha hai entry me to jaha await URL.findOneAndUpdate {} hai uss function ko variable name Dena hai const entry = await URL.findOneAndUpdate {} like this and please bhaiya ke videos aage aage karke mat dekha karo 😂😂

Ответить
Sameer Salim Shaikh
Sameer Salim Shaikh - 01.08.2023 13:30

await is not working for res.redirect
can you please help

Ответить
Honey Sriwas
Honey Sriwas - 31.07.2023 20:37

Getting null in findOneAndUpdate query

app.get('/:shortId', async (req, res) => {
const shortId = req.params.shortId;
const entry = await URL.findOneAndUpdate(
{
shortId
},
{
$push: {
visitHistory: {
timestamp: Date.now(),
},
},
}
);
console.log(entry); // getting Null value

Ответить
ajit shah
ajit shah - 28.07.2023 12:15

how handlegenerateshorturl function get req and res objects?

Ответить