Http-server: Deprecation of ecstatic

Created on 22 Oct 2019  路  6Comments  路  Source: http-party/http-server

This is probably not a bug or a feature request.
More of a _concern_. Just wanted to share with the team in case not known already.

The ecstatic package has been deprecated and here is the feedback from the author.

This may require exploration of an alternative static file server. Any feedback is welcome, Thanks!

Most helpful comment

Right now I'm planning on having the 0.13.0 release of http-server contain its own version of ecstatic to get rid of any deprecation concerns (. Beyond that, we're working on rewriting entirely, which will allow us to get rid of the need for ecstatic and a couple other libraries, and provide a better API.

All 6 comments

I have no real clue about severs but writing my own I used express-static and serve-index in my own simple server.

const express = require('express');
const cors = require('cors');
const serveIndex = require('serve-index');
const expressApp = express();
expressApp.use(cors());
const staticOptions = {
  fallthrough: true,
  index: 'index.html',
};
expressApp.use(express.static(root, staticOptions));
expressApp.use(serveIndex(root, {icons: true,}));
const server = expressApp.listen(8080);

I haven't looked into how to add https certs and the other options that http-server supports

My biggest concern is 100s of popular webpages suggest to new developers they use http-server. I can't fix all those 100s of links to recommend something else so I'd prefer to try to help http-server get fixed. In particular the Windows issue (estatic stopped working correctly with windows where as serve-index above seems to work for me)

I'd love to hear from the maintainer here, how can we (I) help? I see 56 outstanding pull requests so before I go try to submit a PR can you give us some direction about what PRs you'll accept?

Okay well I spent about 6 hours trying to get http-server fixed for some defintion of fixed. I switched to express static and other things and it worked but ...

  • there would be more work if anyone is using it as a library, not just as a command

    mostly that comes down to the express using next instead of emitting an event

  • http-server is currently requiring to run on node 4,5,6,7

    that may or may not be an issue but there is stuff like the deep usage of deprecated util.print and vows being out of date etc..

Finally I just decided that negociating with the developer here to fix this wasn't worth my time so I wrote my own replacement which is here

https://github.com/greggman/servez-cli

I put similar features in. If you just need a command line server, not a library, then consider giving it a try. I've only used it in node 12.

Super thanks to the devs here. I've used http-server for many years and it's been great! I've had a small taste of maintaining open source projecs and I know it can be a thankless job so thanks so much for all your years of support! 鉂わ笍

Kinda curious what's the future of this project if Ecstatic is deprecated. Because this is a very popular repository, even more popular than Ecstatic itself.

@greggman 's server looks interesting too, maybe http-server can becomes a wrapper around it same way Ecstatic currently is?

But honestly, I think Node.js needs a standard build-in static-server, just like .NET core and Python 3 has one...

ecstatic now has a Denial of Service issue identified: https://app.snyk.io/vuln/SNYK-JS-ECSTATIC-540354

Is there any future plan to replace ecstatic?

Right now I'm planning on having the 0.13.0 release of http-server contain its own version of ecstatic to get rid of any deprecation concerns (. Beyond that, we're working on rewriting entirely, which will allow us to get rid of the need for ecstatic and a couple other libraries, and provide a better API.

Was this page helpful?
0 / 5 - 0 ratings