# URL Shortener Feedback :)

**URL:** <https://forum.freecodecamp.org/t/url-shortener-feedback/446152>\
**Category:** I Built This\
**Created:** [February 13, 2021, 8:25pm UTC](https://forum.freecodecamp.org/t/url-shortener-feedback/446152 "2021-02-13T20:25:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sitek94](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sitek94/32/336491_2.png) [@sitek94](https://forum.freecodecamp.org/u/sitek94)\
**Post date:** [February 13, 2021, 8:25pm UTC](https://forum.freecodecamp.org/t/url-shortener-feedback/446152/1 "2021-02-13T20:25:26Z")

</div>

Hello there 👋

Here’s my finished URL Shortener:

Project: [simple-short-url-microservice.herokuapp.com](https://simple-short-url-microservice.herokuapp.com/)

Source Code: [github.com/sitek94/url-shortener-microservice](https://github.com/sitek94/url-shortener-microservice)

I’d greatly appreciate your feedback, thank you! 🥳

* * *

Project instructions and user stories: [URL Shortener Microservice by freeCodeCamp](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/url-shortener-microservice)

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [February 14, 2021, 4:26am UTC](https://forum.freecodecamp.org/t/url-shortener-feedback/446152/2 "2021-02-14T04:26:26Z")

</div>

` `1. You have a mistake in the README - instead of `.sample.env` there is `.env.example`.

` `2. The test for `dnsLookup` is failing for me:

```auto
Expected: "ENOTFOUND"
Received: "EAI_AGAIN"

```

I looked at the docs and seems that this behavior depends on operating system (I’m on linux).

` `3. Tests in `shorturl.test.ts` depend on the order (i.e. if you put `'GET /:short_url'` first, the tests will fail).

` `4. `url-validator.test.ts` doesn’t test anything, because `error-handler.ts` handles error and returns status 200, therefore `catch` is not called (and if it were called, it would fail anyway because to use `toHaveBeenCalled` you need to use mock/spy).

That just some things I noticed after quick look.  
P.S. Kudos for TypeScript and tests 🙂

Btw: [https://simple-short-url-microservice.herokuapp.com/api/shorturl/13](https://simple-short-url-microservice.herokuapp.com/api/shorturl/13) 😈

---

<div class="post-metadata">

**Author:** ![sitek94](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sitek94/32/336491_2.png) [@sitek94](https://forum.freecodecamp.org/u/sitek94)\
**Post date:** [February 14, 2021, 7:37am UTC](https://forum.freecodecamp.org/t/url-shortener-feedback/446152/3 "2021-02-14T07:37:46Z")

</div>

Wow, thank you so much! That’s extremely valuable!! I’m now going to go through everything you said 🙂

> [@jenovs](#):
>
> [https://simple-short-url-microservice.herokuapp.com/api/shorturl/13](https://simple-short-url-microservice.herokuapp.com/api/shorturl/13)

Hahah I see what you did here, I’ll restrict the app’s hostname 😃

* * *

**UP:**

All right I think I got it all fixed now.

1. fixed
2. I created a custom error so it should be now independed of operating system, etc.
3. Ah, so this is what testing in isolation means, right? I updated these tests and added some cleanup so it should be fine now.
4. fixed

Once again thanks for your help and feedback, @jenovs !!!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 15, 2021, 7:38pm UTC](https://forum.freecodecamp.org/t/url-shortener-feedback/446152/4 "2021-08-15T19:38:44Z")

</div>

Closed on August 15, 2021, 7:38pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
