node.js - Getting the Server.serve status code using node-static in Typescript -


i'm trying write of node-static example code in typescript , i'm getting error

property 'status' not exist on type 'error'

here code error

import * server 'node-static'; import * http "http"  var fileserver = new server.server('./images');  http.createserver(function (request, response) {     request.addlistener('end', function () {         var callback: server.callback;         callback = function (e: error) {             if (e && (e.status === 404)) { // error in line                  fileserver.servefile('/not-found.html', 404, {}, request, response);             }         };         fileserver.serve(request, response, callback)     }).resume(); }).listen(8080); 

error has type string , stacktrace, reason typescript error clear.
question how status code.

the original javascript code here

looks @types node-static wrong. link

especially because callback function can have res object.

you can fallback any


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -