How to use cdn on tribute page

How to use cdn on tribute page
0

#1

I’m just about to start the tribute page. In the instructions it says to use codepen or “…you can use this CDN link to run the tests in any environment you like”. I’m assuming this means I can write the code in my code editor instead of using codepen? If so, how do I use the CDN to test my page? I’ve added the CDN in a link tag but am unsure how to use it to test my site!

Any help greatly appreciated!


#2

copy paste the cdn link provided into codepen->settings->javascript


#3

Ok, so I can write the code in Brackets code editor and then just use that link in the way you described?


#4

OK so it works now. I’ve ran my code in the browser from Brackets and the test suite has come up! thanks for the advice sorinr!


#5

If you are writing your code locally and then move it to codepen you can add the test unit at the end of your body tag like

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>

#6

I’ve writing it locally (don’t like codepen) on Brackets.io . . .I added the CDN in a script tag and the test suite in there on my page without the need to use codepen at all!


#7

Its ok to work locally. I do the same but when you finish you will have to share your link to the project so others can test it and give you feedback on it. It is also necessary for the curriculum to share the project


#8

Ah OK, makes sense, so I’ll have to use Codepen after all :roll_eyes: not a problem! Thanks so much for the advice!


#10

You don’t have to if you don’t want to, there are many other services that allow you to host your projects for free, glitch, heroku and jsbin are some that come to mind.


#11

Thanks Aconte, I’ve heard Glitch and Heroku mentioned but not looked into them yet…do you prefer them over CodePen? Are there any benefits of one over the other or are they all pretty much the same functionally, just different interfaces?


#12

Can Github not be used to do this aswell ? im confused now


#14

You can use the CDN in your html file, and when you open that html file with a browser you will see the test suit in the top corner of the screen. If you don’t see it you haven’t used the CDN correctly.
This means you can write your code anywhere, it doesn’t matter, you can still use the CDN test suite. But, when you submit the challenge on FFC the code/html file etc needs to be hosted somewhere on the Internet so that FCC can access it. Codepen is an easy option for newbies, as are the aforentioned ones.

Hope this helps!