Session 12: Practicing with web servers - myTeachingURJC/2018-19-PNE GitHub Wiki

  • Goals:
    • Practicing with web servers
    • Practicing with HTML
  • Duration: 2h
  • Date: Week 6: Wednesday, Feb-27th-2019

Contents

Practice 4

  • Place all the files in your P4 Folder in your 2018-19-PNE repo in github
  • Program a web server (using sockets) that gives the user access to three different pages written in HTML and stored in the following files:
    • index.html: Main page (yellow)
    • blue.html: A different page with blue background
    • pink.html: A different page with pink background
    • error.html: An error page with red background
  • The server should work as follows:
    • If the user request the / resource, it should return the index.html file
    • If the user request the /blue resource, it should return the blue.html file
    • If the user request the /pink resource, it should return the yellow.html file
    • If the user request a different resource than the previous, It should return the error.html file
  • The index.html page should contanin a link to the /blue and /pink URLs. The blue.html and pink.html should containg a "home link" to return to the index.html page
  • Tips:
    • This is the HTML example code for including a link:
<a href="www.urjc.es">Mi link a la URJC</a>

Authors

Credits

  • Alvaro del Castillo. He designed and created the original content of this subject. Thanks a lot :-)

License

Links