Skip to content
Permalink
Browse files
  • Loading branch information
aa7401 committed Sep 12, 2019
2 parents deb39f3 + 1c92266 commit 922bb3d
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 42 deletions.
@@ -25,3 +25,5 @@ website.db
# IDE setting files
*.codio
*.c9

messages.txt
@@ -1,9 +1,11 @@

# The HTTP Protocol

In the lecture you learned about the HTTP protocol which is used to transfer information between web server and the web browser. Without this the World-Wide Web (WWW) would not exist. This lab will allow you to apply this knowledge and learn the details. In this lab you will be using the [NodeJS](http://nodejs.org) [Express package](https://www.npmjs.com/package/express) to write scripts that make use of this protocol.
In the lecture you learned about the HTTP protocol which is used to transfer information between web server and the web browser.

The HTTP protocol is used by web servers to send content to devices such as web browsers. It uses a [request-response](https://en.wikipedia.org/wiki/Request–response) mechanism which involves a _client_ device sending a request to the server. This request includes:
The HTTP protocol is used by web servers to send content to devices such as web browsers. Without this the World-Wide Web (WWW) would not exist. In this lab you will be using the [NodeJS](http://nodejs.org) language running the [Koa web server](https://www.npmjs.com/package/koa) to write scripts that make use of this protocol.

HTTP uses a [request-response](https://en.wikipedia.org/wiki/Request–response) mechanism which involves a _client_ device sending a request to the server. This request includes:

1. The _resource_ it is requesting (defined as a [URL](https://en.wikipedia.org/wiki/URL)).
2. Additional information such as filters (provided as one or more [query strings](https://en.wikipedia.org/wiki/Query_string)).
@@ -1,7 +1,7 @@

# Learning HTML5

Before you start you need to pull any _upstream changes_. Detailed instructions can be found in the **Setup** lab.
Before you start you need to pull any _upstream changes_. Detailed instructions can be found in the **Setup** lab. You should get into the habit of doing this each time you sit down to work on your lab exercises as you will then be working on the latest versions of the files (with fewer bugs).

In this worksheet you will be learning about the markup language HTML which is currently in version 5. The worksheet is split into five parts with the resources for each part in their own subdirectory. The `template.html` file contains a basic HTML5 template you will find useful when creating your own web pages.

@@ -17,11 +17,9 @@ In this worksheet you will be learning about the markup language HTML which is c
   └── template.html
```

You should get into the habit of doing this each time you sit down to work on your lab exercises as you will then be working on the latest versions of the files (with fewer bugs).

## 1 Syntax

Lets take a look at some basic HTML syntax. Start by locating the `exercises/02_html/01_syntax/` directory. Navigate to this using the SSH Terminal, install the all the necessary `koa` packages and start the web server. If you navigate to the base route `/` you will see a screen full of text.
Lets take a look at some basic HTML syntax. Start by locating the `exercises/03_html/01_syntax/` directory. Navigate to this using the SSH Terminal, install the all the necessary `koa` packages and start the web server. If you navigate to the base route `/` you will see a screen full of text.

![the unformatted text](exercises/.images/chrome_07.png)

@@ -90,7 +88,7 @@ Now you have mastered the basics of HTML markup we will look at one of the most

### 3.1 Routes

Every resource on the WWW (such as html documents and images) has a unique URL and so when we design our website we need to define these. In a website built using _NodeJS_ and _Koa_ these are known as **routes**. Start by locating the `exercises/02_html/03_hypermedia/` directory. Start the web server and open the `index.js` file.
Every resource on the WWW (such as html documents and images) has a unique URL and so when we design our website we need to define these. In a website built using _NodeJS_ and _Koa_ these are known as **routes**. Start by locating the `exercises/03_html/03_hypermedia/` directory. Start the web server and open the `index.js` file.

1. Some resources need to be directly accessible in the web browser (they are accessed either directly or loaded by the html web page). These need to have their own directly accessible URL.
1. One directory needs to be specified as being publicly available. In this example we have created a directory called `public/`

0 comments on commit 922bb3d

Please sign in to comment.