I have learned Angular2 instead of React and need help setting up CodePen to work with Angular. I am pretty comfortable in setting up environment for Angular 2 on my local machine but not on CodePen. Can you guys please help me with the same?
Not sure if this is possible, but isn’t it easier to develop locally?
Yes it is. But I am not sure how will I host it so that freecodecamp recognize that the project is completed.
If you are using the angular cli, you can just
ng build your project and put those outputted files (usually in your /dist folder) on github pages, surge.sh or any other hosting site.
freeCodeCamp is okay with you coding it your way. The only stipulations as I’m aware of them are that the code must be publicly viewable (achievable by pushing to Github) and useable (achievable by also pushing a complete build to Github and using Github Pages or pushing to something like Heroku… I’ve used both depending on the type of project).
From the FAQ (at the bottom of the About page):
Do I have to use CodePen for the front end projects?
As long as your code is publicly viewable, and you have a live demo, you can use whatever you want.
I have configured a test repository for hosting on github pages but it is giving me an error. I have created a docs folder in my repo which contains index.html file.
File not found
The site configured at this address does not contain the requested file.
If this is your site, make sure that the filename case matches the URL.
For root URLs (like http://example.com/) you must provide an index.html file.
I believe the
index.html should be in the root folder. Also, github pages serves your website only from a
I have configured a gh-pages branch and have my index.html file in root directory of this branch. The website seems to be hosted but I am getting error in console of the browser. I think the problem is
my address: https://ayush987goyal.github.io/testrepo/
But it is looking for files under:
How do you think I must fix it?
I didn’t need a special branch. I was able to run it from master.
I also see a
<base> tag in your code. Could that be redirecting to
yes I think that might be the problem. Thanks a lot guys. I am able to publish my website now.