We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 462f5f2 commit a91b7c2Copy full SHA for a91b7c2
Lesson03/exercise_004/index.js
@@ -14,10 +14,9 @@ console.log(`Loaded ${products.length} products...`);
14
15
handlebars.registerHelper('currency', (number) => `$${number.toFixed(2)}`);
16
17
-const htmlTemplate = fs.readFileSync('html/index.html').toString();
+const htmlString = fs.readFileSync('html/index.html').toString();
18
+const template = handlebars.compile(htmlString);
19
function handleProductsPage(requestUrl, response) {
- const template = handlebars.compile(htmlTemplate);
20
-
21
response.writeHead(200);
22
response.write(template({ products: products }));
23
response.end();
0 commit comments