question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with express

See original GitHub issue

It is a very interesting idea of super fast http server 😃. But unfortunately it is crashes on every request on different places. I’m using node v8.9.4.

When I try to use turbo-http with express everything is crashed.

$ npm i express-generator -g
$ mkdir turbu;
$ cd turbo
$ express
  create : .
   create : ./package.json
   create : ./app.js
   create : ./public
   create : ./routes
   create : ./routes/index.js
   create : ./routes/users.js
   create : ./views
   create : ./views/index.jade
   create : ./views/layout.jade
   create : ./views/error.jade
   create : ./bin
   create : ./bin/www
   create : ./public/javascripts
   create : ./public/images
   create : ./public/stylesheets
   create : ./public/stylesheets/style.css

$ npm i @mafintosh/turbo-http

I Changed in bin/www: http -> @mafintosh/turbo-http.

And after start and making request I see:

coderaiser@cloudcmd:~/2$ node bin/www
(node:12532) Warning: N-API is an experimental feature and could change at any time.
/home/coderaiser/2/node_modules/finalhandler/index.js:130
      req.socket.destroy()
                 ^

TypeError: req.socket.destroy is not a function
    at Immediate.<anonymous> (/home/coderaiser/2/node_modules/finalhandler/index.js:130:18)
    at Immediate._onImmediate (/home/coderaiser/2/node_modules/express/lib/router/index.js:635:15)
    at runCallback (timers.js:791:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

When I try to use turbo-http in edward error was:

/home/coderaiser/edward/node_modules/send/index.js:613
  var ranges = req.headers.range
                           ^

TypeError: Cannot read property 'range' of undefined
    at SendStream.send (/home/coderaiser/edward/node_modules/send/index.js:613:28)
    at /home/coderaiser/edward/node_modules/send/index.js:775:12
    at FSReqWrap.oncomplete (fs.js:153:5)

When I try to use it with cloudcmd I got:

coderaiser@cloudcmd:~/cloudcmd$ node bin/cloudcmd.js
(node:12906) Warning: N-API is an experimental feature and could change at any time.
url: http://localhost:31337/
_stream_readable.js:718
  if (state.pipesCount === 0)
            ^

TypeError: Cannot read property 'pipesCount' of undefined
    at Request.Readable.unpipe (_stream_readable.js:718:13)
    at unpipe (/home/coderaiser/cloudcmd/node_modules/unpipe/index.js:47:12)
    at send (/home/coderaiser/cloudcmd/node_modules/finalhandler/index.js:289:3)
    at Immediate.<anonymous> (/home/coderaiser/cloudcmd/node_modules/finalhandler/index.js:135:5)
    at Immediate._onImmediate (/home/coderaiser/cloudcmd/node_modules/express/lib/router/index.js:635:15)
    at runCallback (timers.js:791:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

Would be great to have ability to use turbo-http with express 😃

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
lukeedcommented, Mar 2, 2018

I’m looking forward to trying this with Polka later today 🕺

4reactions
mafintoshcommented, Mar 2, 2018

The API is different in places from Node.js core. It most likely will never be fully compatible for perf reasons. What should happen (ideally…) would be for new cool JSON api frameworks to be built on top 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express Node.js doesn't work - Stack Overflow
So I have no idea of which port express is running on or whether or not it is running at all.
Read more >
Express Static Not Working - The freeCodeCamp Forum
Hello! I recently started working through the Express tutorial and got snagged on the section where you setup the express.static middleware ...
Read more >
Express/Node introduction - Learn web development | MDN
While Express itself is fairly minimalist, developers have created compatible middleware packages to address almost any web development problem.
Read more >
Error handling - Express.js
Error Handling. Error Handling refers to how Express catches and processes errors that occur both synchronously and asynchronously. Express comes with a ...
Read more >
App.get() not working with express.js - Glitch Support
Hello. I'm trying to create an API that connects to my bot's dashboard, but when I try to access the api page, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found