By now you should know enough to be dangerous. There's definitely more to learn but you already know enough about Node to actually make something! So lets do it! You will be creating a very basic informational site that contains 4 pages: index, about, contact-me and 404. Keep in mind that the content of these pages isn't really all that important. So there's no need to spend a lot of time filling them up or trying to make them look pretty.
If you get stuck at anytime, feel free to go back to the tutorial from the previous lesson.
-
Make a project directory and create the following files inside that directory:
- index.html
- about.html
- contact-me.html
- 404.html
-
Create your node.js server file
index.jsand add the code needed to serve the right page according to the url.- localhost:8080 should take users to index.html
- localhost:8080/about should take users to about.html
- localhost:8080/contact-me should take users to contact-me.html
- 404.html should display any time the user tries to go to a page not listed above.
To add your solution to the list below, edit this file (located on The Odin Project's "curriculum" github repository). See the section on Contributing for more instructions.
If you're planning to submit a live demo with your student solution, one of the easiest ways to do that is using Repl.it. To do this:
- Go to Repl.it
- Create a new repl
- Select Node.js as the language
- Enter the url for your submission github repo and click "Import from GitHub"
- Click the "Run" button and you should get the URL to your demo in the URL bar of the repl's web view.
Show Student Solutions
- Add your solution below this line!
- Kris Tobiasson's Solution - View in Browser
- martink-rsa's Solution - View in Browser
- Henrique Sousa's Solution - View in Browser
- autumnchris's Solution - View in Browser
- Brendo's Solution
- Alain Suarez's Solution - View in browser
- ARaut9's Solution
- Vollantre's Solution
- MikkRou's Solution - View in browser
- Eljoey's Solution
- Vedat's Solution - View in browser
- Henry Kirya's - View in browser
- Brian Tuju's Solution
- tbmreza's Solution - View in browser
- Carmine's Solution - View in browser
- Faraz's Solution
- c-Nosetab's Solution
- Dom's Solution
- Rayan's Solution
- Jacob's Solution
- Unwana's Solution
- Khalal's Solution
- Jake's Solution
- ericzlmd's Solution
- GustavoRdz's Solution
- Viho Serge
- Avic Ndugu - View in browser
- Ryan Floyd's Solution
- Mitchell's Solution
- Kale33's Soltuion
- Aron's Solution
- Fred's Solution