I’ve logged the route inputs and the then clause of your POST:
req.body: {"url":"https://boilerplate-project-urlshortener-25.jeremyagray.repl.co/?v=1657978325086"}
req.params: {}
req.query: {}
doc: null
TypeError: Cannot read property 'original_url' of null
at /home/runner/boilerplate-project-urlshortener-25/index.js:86:29
at processTicksAndRejections (node:internal/process/task_queues:96:5)
So, where you think you have a document, you have null. I didn’t track down where that’s happening, but it’s either in the DB configuration and access or to do with your shortenUrl helper being asynchronous but not being called that way. Your other helper function has the same problem.
I would examine the DB configuration and possibly use mongoose like in the practice exercises for a simpler approach. If you are actually getting the documents running the project manually, then it’s most likely the inconsistent async handling. You’ll need to handle all the async DB calls like findOneAndUpdate() and findOne() or you’ll get unresolved promises returned instead of your data.