Projetos API .preciso de ajuda

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

You have to edit that and get it to do what the project requires.

And don’t keep creating forks. You’ve created 8 forks today.

Delete the old ones, and just use the more recent.

https://boilerplate-project-timestamp-12.beatrizgames.repl.co
Não consigo entender…

But WHAT can’t you understand? We can’t start explaining the entire history of computers until we get to the part that you don’t understand. What specific instruction do you not understand. Look at the instructions for this project and copy and paste that instruction here and ask what you don’t understand.

And I say this as someone that also had a difficult time transitioning to the API projects - it is a difficult transition. But we can’t help you if we don’t know what the issue is.

Bom Não precisa explicar a teoria de tudo… E se eu estiver te atrapalhando com os seus afazeres e só me ignorar e não responder mais… não pedi ajuda , voce ofereceu. Eu fiz copiei e colei o projeto pronto q você mandou. No replic parece tudo certo mas jogo no projeto não passa.

Tudo bem pode deixar me viro bem sozinho. Estou começando agora ,Ja fiz todos os cursos do freecodeCamp e projetos até aqui . Eu vou até o fim…

I guess I misunderstood, “preciso de ajuda” in the title.

That’s what we do in this forum - people ask for help and someone offers to help.

I’m just saying that if you want help from anyone, please ask a specific question.

Tudo bem! Parece q o código que está Jó próprio Fórum que algeum5 postou parece mais coerente…

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

  //A 4 digit number is a valid ISO-8601 for the beginning of that year
  //5 digits or more must be a unix time, until we reach a year 10,000 problem
  if (/\d{5,}/.test(dateString)) {
    let dateInt = parseInt(dateString);
    //Date regards numbers as unix timestamps, strings are processed differently
    res.json({ unix: dateString, utc: new Date(dateInt).toUTCString() });
  } else {
    let dateObject = new Date(dateString);

    if (dateObject.toString() === "Invalid Date") {
      res.json({ error: "Invalid Date" });
    } else {
      res.json({ unix: dateObject.valueOf(), utc: dateObject.toUTCString() });
    }
  }
});

Q também não passa…

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Once again, I can’t tell which replit you are using.

I have spent a lot of time running around the tree trying to get an answer.

Please decide which version of this you want. Your last link was to version 12. But your code seems to be from version 13. But I can’t get that replit to wake up.

Again, I suggest deleting every timestamp replit that is not the one on which you are working.

I don’t want to debug your code out of context. Please provide a link to the code that is the issue. And please make sure it is a replit that can load. Then I can see the code and see how it is failing.

Isso aconteceu nos exercícios mongoose.
O Daniel me passou sua réplica e funcionou.

OK, I guess I can’t help you then. Best of luck.

1 Like

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