We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b6bd21 commit 462f5f2Copy full SHA for 462f5f2
1 file changed
Lesson03/exercise_004/index.js
@@ -47,15 +47,12 @@ function handleRequest(request, response) {
47
const requestUrl = url.parse(request.url);
48
const pathname = requestUrl.pathname;
49
50
- switch(pathname) {
51
- case '/':
52
- case '/index.html':
53
- handleProductsPage(requestUrl, response);
54
- return;
55
- default:
56
- handleStaticFile(pathname, response);
57
+ if (pathname == '/' || pathname == '/index.html') {
+ handleProductsPage(requestUrl, response);
+ return;
58
}
+
+ handleStaticFile(pathname, response);
59
60
61
function initializeServer() {
0 commit comments