Giter VIP home page Giter VIP logo

final-homework's Introduction

Salve Dev! Eu sou Andre Oneti 👋!

Avatar do André

Bem vindo ao meu GitHub!


final-homework's People

Contributors

andreoneti avatar

Stargazers

 avatar

Watchers

 avatar  avatar

final-homework's Issues

Handle requests to replicate morgan logger

var startAt = Date.now();
res.on("finish", () => {
  console.log(req.method, req.originalUrl, res.statusCode, `${Date.now() - startAt} ms -`, res._contentLength.toString());
});

Auth denied response.

HTTP/1.1 401 Unauthorized
Date: Fri, 01 Nov 2019 12:42:52 GMT
Server: Apache/2.4.25 (Debian)
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
Content-Length: 42
Connection: close
Content-Type: text/html; charset=UTF-8

"You Shall Not Pass!" - White, Gandalf the

Update secondsToDhms function

function secondsToDhms(seconds) {

function secondsToDhms(seconds) {
  seconds = Number(seconds / 1000);
  var d = Math.floor(seconds / (3600 * 24));
  var h = Math.floor(seconds % (3600 * 24) / 3600);
  var m = Math.floor(seconds % 3600 / 60);
  var s = Math.floor(seconds % 60);
  var ms = Math.floor((seconds * 1000) % 1000);

  var dDisplay = d > 0 ? d + (d == 1 ? " day, " : " days, ") : "";
  var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : "";
  var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : "";
  var sDisplay = s > 0 ? s + (s == 1 ? " second, " : " seconds, ") : "0 seconds, ";
  var msDisplay = ms > 0 ? ms + (ms == 1 ? " milisecond" : " miliseconds") : "0 miliseconds";
  return dDisplay + hDisplay + mDisplay + sDisplay + msDisplay;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.