Chain Middleware to Create a Time Server 1

Tell us what’s happening:
Describe your issue in detail here.
The /now endpoint should have mounted middleware
The /now endpoint should return a time that is +/- 20 secs from now

app.get( "/now", (request, response, next) => { request.time = new Date.toString(); next(); }, (request, response) => { response.json({ time: request.time }); } );

Your project link(s)

solution: Glitch :・゚✧

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36

Challenge: Chain Middleware to Create a Time Server

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.