how can i make url shortener api in express.js?

I’m doing a link shortener. The link shortener works very well but now I’m trying to do API for it. The problem is that if I pass the URL argument in the get URL it’s not working. I tried a lot of things but it’s not working. When I do like http://localhost:3500/api/create/google.com it works but when I do http://localhost:3500/api/create/https://google.com it’s not working because of the https://. These are the last 3 inputs via my API that failed: http://https:google.com, google.com, http://
I’m using express and mongoose. Here’s my code:

app.get('/api/create/:shortUrl(*)', async (req, res, next) => {
if (req.params.shortUrl.includes("https://") || req.params.shortUrl.includes("http://") || req.params.shortUrl.includes("/")) {
    req.params.shortUrl = req.params.shortUrl.replace("https://", "").replace("http://", "").replace("/", "")
}
if (req.params.shortUrl == "") {
    res.send("invalid URL")
}
    await shorturl.create({full: `http://${req.params.shortUrl}`})
    const shortUrls = await shorturl.find().sort({_id: -1}).limit(-1)
    const latest = shortUrls[0]
    res.send("https://p33t.link/" + latest.short)

});