Comments (4)
You can't set headers before using this middleware? Example:
app.use(cors()); // npm view cors
app.use(static); // returned from ecstatic()
from node-ecstatic.
uhm, I guess could.. It is just because I'm using http-server and thought it was just a simple wrapper to ecstatic
(now I see they also use union...)
I'm still not sure what is the best option (add this setting to ecstatic or to http-server) but feel free to close it if you think it is not necessary, as you said it is pretty easy to inject the headers to the response in any case. - I will need to ask for a pull request on http-server anyway...
Thanks.
from node-ecstatic.
Yes, http-server is a wrapper around ecstatic.
I'm not really interested in adding more features to ecstatic itself, though perhaps this would be a useful addition to http-server. Personally, I'd recommend only using the ecstatic/http-server cli tools for testing, and use either a custom server or something like nginx for static assets in production.
from node-ecstatic.
yeah, I'm only using it to test things locally that way I don't need to setup apache/nginx for quick stuff... (way easier to start/stop) and as a replacement for python SimpleHTTPServer which is way slower and have some issues w/ multiple consecutive file requests.
I'm trying to run it from a different port/domain that way I can load the static files from my local machine and execute the server-side scripts from a different machine/VM/host as a hack to speed up development on a slow server and load things in parallel (poor man's domain sharding).
opened the issue on http-server (http-party/http-server#43), thanks a lot for the feedback and all the good work.
cheers!
from node-ecstatic.
Related Issues (20)
- baseDir does not work correctly when mounted non-root, and is not necessary HOT 5
- Unable to run CLI due to invalid line endings on Linux HOT 6
- Serve file with default ext is same name dir cannot be shown HOT 2
- Move off of airbnb for linting
- Does the current charset detector actually even work?
- Revamp the directory structure and shape of imports?
- What version of Node are we targeting? (OutgoingMessage & emit close) HOT 1
- Most status code handlers don't have a way of delegating to next() HOT 1
- Rewrite tests to use pickleback
- npm high severity vulnerability HOT 8
- releases available via npm HOT 76
- Version 1.4.0 gone in npm HOT 2
- Add support for JSON directory indices HOT 2
- ecstatic's Past, Present and Future HOT 17
- Windows Infinite 302 Redirection HOT 1
- continue maintaining ecstatic HOT 4
- Failed to compile while building with webpack as dependency HOT 1
- ecstatic stable version
- Vulnerability
- c2de337332a5137944c117000b13d368ce6e24f6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ecstatic.