URL Shortener project with testable user stories - Guinea Pigs needed 🐹

As you may have heard, @em-ant, @Greenheart, and @systimotic have been hard at work building projects with testable user stories. We are looking for a few volunteers to attempt to build these based on their automated tests.

The goal is for campers to be able to build these projects step by step following user stories. This will make the projects less intimidating and more fun. Oh, and don’t worry - we’ll still have plenty of optional projects where we don’t provide you with any tests. And if you’ve previously built these projects, you don’t need to build them again.

If you’re interested in attempting this, please reply to the thread and let us know you’ve started it. The more people who want to build this, the better, as we can start gathering feedback.

Thanks, and happy coding!

The project tester (enter the public HyperDev URL for your project and set it to MS3-url shortener): https://narrow-plane.hyperdev.space/

Working example: https://thread-paper.hyperdev.space/

Boilerplate to remix: https://hyperdev.com/#!/project/pastoral-caution

Note that in order to build this project, you need to first add an mLab URI to your .env file.

Also, your tests must be run sequentially

I’m going to start this project today. I’ll be using a custom domain name, so I’ll have to add some routes just for the purpose of the automated tests hitting them.

Is there any chance that the option to customize the API endpoints could be added? For example, to cause the automated tests to optionally GET [base url]/[short url] instead of GET [base url]/api/shorturl/[short url]? I know it’s an edge case, but it might be nice for people who are hosting on platforms other than hyperdev.

1 Like

I’ve completed this but I will try to pair with someone who hasn’t done it.

1 Like

I’m not sure. This would be a good question for @greenheart or @systimotic.

Ok, I just got the last automated test to pass! :smile:

It seems to work well although my project is hosted on my VPS.


My feedback:

I had some trouble getting the last test (5. Invalid URL) to pass. I was returning a json object of the correct format, but I was also setting the HTTP status of the response to 400. The test wouldn’t pass until I returned a response with a 200 status. It seems to me that a 400 status would be more appropriate in the case of the client passing an invalid URL. Would it be possible to have the automated test check for the correct json regardless of the status?


I just finished the url shortener service (just on c9 so far - have not yet hooked it up to Heroku) and would like to contribute to the project if I can. What is the first step? How does this work?

1 Like

Fork the boilerplate and start building. You can use the tester to check whether you’ve met the individual user stories.

I had to modify my old url shortener a good bit to make it work with the current tests, but everything works now.
Code : https://gomix.com/#!/project/juniper-puppy

I’ve built this project, and it works fine, but when I test it with https://narrow-plane.glitch.me/, it fails tests 2 and 4 with error message saying only ‘error’ (I ran these tests sequentially, so that shouldn’t be the cause of the problem). I tried to test the example project, https://thread-paper.glitch.me, and the result is the same. In the developer console it prints the following: "XMLHttpRequest cannot load https://curse-arrow.gomix.me/api/timestamp. Redirect from ‘https://curse-arrow.gomix.me/api/timestamp’ to ‘https://curse-arrow.glitch.me/api/timestamp’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access."
So, is that a bug or is there a problem in my code? My project is here: https://glitch.com/edit/#!/literate-ravioli

I have the same issue, maybe it’s a CORS problem on the tester app

@Enikol Thanks for discovering this issue. Could you open a GitHub issue describing this?

Done! https://github.com/freeCodeCamp/testable-projects-fcc/issues/154
I also think I found the problem (it’s described in the issue, but I can’t open a PR because I can’t find the source code for the testing app.

Thanks for the note about the response status codes! I was also using 400/404 status codes to handle invalid requests and this prevented the last test from passing. Frustrating…