Guys pls i need help i believe i have done everything but FCC is bouncing me back - Timestamp

Tell us what’s happening:
Describe your issue in detail here.

Your project link(s)

solution: https://replit.com/@codewithvico/boilerplate-project-timestamp-1

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15

Challenge: Timestamp Microservice

Link to the challenge:

I’ll look at this test because it is a little easier:

A request to /api/1451001600000 should return { unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }

When I look in the devtools for and find the network traffic for that test, I find this:

That all makes sense.

When I use your test page, and hit that example, I see this:

Do you see the difference?

This is the relevant code:

app.get("/api/timestamp/:date_string", (req, res) => {
  // ...

Let me know if my hints aren’t clear enough. You have the right idea, you just misunderstood a detail in the instructions.

Thanks alot for ur time,

Omitting the timestamp/:date_string
with what i can see.

Pls Can u help explain further?

Did you take a look at my source code?

because i still can’t pass through this test.

Thanks

I’m not sure I understand. The point is that you have a different route than the test expects.

Did you take a look at my source code?

I literally quoted your code.

But again, the test expects this:

A request to /api/1451001600000 should return { unix: 1451001600000, utc: “Fri, 25 Dec 2015 00:00:00 GMT” }

and you have this:

app.get("/api/timestamp/:date_string", (req, res) => {
  // ...

Do you see the letters “timestamp” in the route that is being tested? Can we agree that “/api/timestamp/:date_string” and “/api/:date_string” are two different routes?

Yes, i can see that
The first route is to get the Right ‘now’ date
Next is to get the params, used Int to pass the new condition
then, i give my response as json.
The last was to pass in a value with a condition.

I noticed when i test mine it works but returns an err in my console

read below;

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:530:11)
at ServerResponse.header (/home/runner/boilerplate-project-timestamp-1/node_modules/express/lib/response.js:776:10)

Thanks for your time again.

I don’t know what you are talking about.

The test referenced wants this route: /api/1451001600000

Can you show me which route in your code would catch that?

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

I don’t know - usually that means that you are trying to do something with the response after it is sent.

Don’t worry i will handle it , thanks for your time.

I got the trick now…

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