Node.js and Express are key building blocks for JavaScript-based web development.
Start with a basic server.
Implement the hello-world application specified here:
Express (Do the “Getting started”→“Installing” & “Hello world” sections.)
When you have the server running, make sure that you can modify the output text, route and port at will and then answer the following questions.
package.json
file.
Save your answers to these questions so that you can add them to your webpage (below).
Note that you should be able to run your server using either of the following commands.
node yourServer.js
npm start
(NB. To get this to work, you must add a start
script of the form: 'start': 'node app.js'
to your package.json
file.)
Now, you can serve up some static files.
Configure your server to serve up static files from a public
directory, see the “Static files” section of the Express
tutorial. When you have it running, serve up a static text file, make
sure that you can edit it and see the results, and then answer the
following questions.
Save your answers to these questions so that you can add them to your webpage (below).
Serve up a simple webpage that combines HTML, CSS and JavaScript.
Build a webpage that looks something like the example shown on the right. Include at least the following:
Separate but integrated files for:
Answers to the lab exercises in the form of nested lists (i.e.,
use the <ul>
and <li>
tags).
See examples of how to integrate these files in the public
directory of the GitHub repo for this unit.
Use Chrome DevTools to monitor the browser’s rendering of this webpage. Find out what files are loaded, in what order and how long it took. Note when the message is written to the console log.
Submit your solution to GitHub. We will grade your work according to the following criteria:
package.json
file