Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Burhan L
Front End Web Development Techdegree Student 4,069 Pointsputting these files onto my own website server
if I want to put these files on to my website server. How does it work? If I just transfer all the files and the src folder, will it appear on the website? as far as I remember, websites recognize index.html as the root/homepage
any guidance would be helpful
this is regarding the express lesson on making a website
3 Answers
Iain Simmons
Treehouse Moderator 32,305 PointsIf you're talking about an Express site, then you need a server running Node.js, so that may complicate things a little, and just placing all the files on the server won't cut it.
Heroku is a very popular solution. They have a good tutorial for deploying a Node.js app.
There's also an article on Scotch.io on the same topic.
Jeffrey Ruder
6,408 PointsOnce you've uploaded a JavaScript file to your web server, you just need to make sure there's a script tag in the HTML document where you want the script to run.
<script src="myscripts.js"></script>
You need to make sure the src path is the correct path to the JavaScript file. So for example the code above would only work if the .js file is in the same place as the HTML file. If the .js file was in a separate directory you might need something like src="/scripts/myscripts.js"
It's also important to remember that the script will run once the browser has loaded the part of the page where the script tag is. It's usually polite to put script tags near the end of the HTML file, so the rest of the page loads first and people don't see a blank page while the script is running.
Hope this helps you.
Amandeep Dindral
8,915 PointsHi,
If you go to the "Front End Web Development Track" and click on "How to Make a Website" there is course titled "Sharing a Website." I think this is exactly what you are looking for.
Let me know if this helps!
Cheers