- Create a file
index.js
- Now, using the
http
core module, create a web server that would handle requests to a Used Goods Marketplace SaaS product as detailed in the following questions
Note: The server must be running on port 8000
and display a message "Server initiated on port 8000..." when it the server is started
- When a user navigates to the root URL of the web server, the server must display a message "Welcome to the BarterX"
- When a user navigates to the
/products
URL, the server must display a message "Here are the products up for Sale in BarterX" - When a user naviages to the
/login
URL, the server must display a message "Login to the BarterX" - When a user navigates to the
/signup
URL, the server must display a message "Sign up to the BarterX" - When a user navigates to the
/profile
URL, the server must display a message "Trader Profile" - When a user navigates to the
/cart
URL, the server must display a message "Your Shopping Cart is here" - When a user navigates to the
/checkout
URL, the server must display a message "Lets' start shipping" - When a user navigates to the
/orders
URL, the server must display a message "Your Orders are here" - When a user navigates to the
/categories
URL, the server must display a message "Browse Categories" - When a user navigates to the
/chat
URL, the server must display a message "Your Chat with fellow Traders" - When a user navigates to the
/contact
URL, the server must display a message "Contact Us at" - When a user navigates to the
/about
URL, the server must display a message "The modern approach to trading our commodities" - For any other page, the server must display a message "Page not found"
Bonus: Maintain a log.txt
file that keeps track of every request that the server receives along with details about the time and date of the request, request url