In this lesson, we build a very simple Express server. This server will have a single route that displays the current date and time and a handler for 404 pages.
Hello Joel, is there a specific reason you used (new Date()).toLocaleTimeString() and not new Date().toLocaleTimeString()
There were no specific reason, mostly readability.
I am receiving this message Server time is ${localTime}. time is not rendering.
const express = require("express");
const app =express(); const PORT = 8888;
app.get("/status", (requestAnimationFrame, res) => { const localTime = (new Date()).toLocaleTimeString(); res .status(200) .send('Server time is ${localTime}.');
});
app.get("*", (Reflect, res) => { res.sendStatus(404); });
app.listen(PORT, () => { console.log('Server is running on port ${PORT}.'); });
i see I dont know how animation got in there
I am receiving this message Server time is ${localTime}. time is not rendering.
You are using ' for the string. Try using backticks (`). For more info on this topic, take a look at https://egghead.io/lessons/javascript-use-template-literals-in-es6