/express-web-server

An express server with HTML served via static directory

Primary LanguageJavaScript

logo

Express Web Server

GOAL: Create an express server with HTML served via static directory

Setup

After forking and cloning this repository:

  1. Initilaize your project with npm: npm init -y
  2. Install express using npm: npm install express

Directions

  1. Require express in your server.js file.
  2. Assign the express method to a constant variable named app
  3. Assign the value 3000 to a constant variable named port
  4. Make sure you connect your server file to port 3000
  5. Create a directory at the root named public
  6. Create an index.html in your public directory with an h1 that says hello world
  7. Run your project using node server.js
  8. Make a request to your web server by going on a web browser and running http://localhost:3000