https://github.com/nullthefirst/brf-web-server
https://github.com/nullthefirst/brf-web-server
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nullthefirst/brf-web-server
- Owner: nullthefirst
- Created: 2024-08-22T07:28:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-22T07:29:38.000Z (over 1 year ago)
- Last Synced: 2025-10-23T08:42:51.623Z (6 months ago)
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Exercise: Build a Simple Web Server
**Objective:**
Understand how to build a web server from scratch using plain JavaScript and compare it with creating the same server using Express, a web framework for NodeJS.
#### Part 1: Plain Node
1. **Create a Simple HTTP Server: (Individual)**
- Use Node.js's built-in `http` module to create a simple web server.
- The server should handle two routes: `/` (home) and `/about`.
- In the `/` route, return a simple welcome message.
- In the `/about` route, return basic information about yourself (e.g., your name, interests, or a short bio).
- Ensure the server returns a 404 status with a custom message for any other routes.
2. **Discuss the Challenges: (Group)**
- After completing the server, identify and discuss the challenges faced, such as routing, handling different HTTP methods, and setting up middleware.
#### Part 2: Using Express
1. **Rebuild the Server with Express: (Individual)**
- Set up the same server using Express.
- Ensure it has the same routes (`/` and `/about`), with the `/about` route returning your basic information.
2. **Compare and Discuss: (Group)**
- Compare the two approaches and discuss the benefits of using Express.