Comments (1)
Hey @zyrolasting,
Thank you for opening this issue! We know serveStatic has quite a few short-comings. In fact, its almost easier at this point to just wire the fs
module directly up to restify as opposed to trying to use this middleware. To answer your question, your approach looks pretty sane from a high level.
serveStatic has been a point of contention for a while. Dicussion is fragmented across a few different issues over at https://github.com/restify/node-restify
I believe the current plan is to eventually move serveStatic out into it's own module outside of the restify repo. The thought process is that restify is designed for building semantically correct, production ready, REST services designed for scale. Serving static content is outside of that wheelhouse. In addition, Node.js isn't the best at serving static content, you often get better mileage by fronting your restify service with NGinx for that use case. We know a lot of people are building webapps with restify, and that serving static content directly from Node.js simplifies that use case, so we are going to try to do this with care. If you would be interested in helping with that effort, or just want to chime in on the discussion, let us know ❤️
In the meantime, we are merging the plugins back into the core restify repo. Feel free to open an issue over there if you still have questions and I would be happy to help 😄
from plugins.
Related Issues (20)
- Adding bodyParser twice to the handler chain causes requests to blackhole. HOT 1
- Tests are now failing on master
- metrics plugin is reporting the full path, and not the paramaterized path. HOT 1
- Remove CORS
- Deprecate restify-plugins HOT 3
- dedupeSlashes plugin
- Fix unit tests for node6
- The serveStatic plugin leaks file handles HOT 2
- It would be cool if the Throttle could be used depending on the specific errors HOT 2
- Expose csv-parse options in body parser HOT 3
- Add application/EDIFACT mime type HOT 2
- Make bodyParser more open and customizable
- queryParser: whether to limit and explicitly list which qs.parse options are passed through HOT 4
- Audit logger should include option to record current user HOT 2
- Throttle should place limits in header HOT 1
- why does context plugin persist data across requests? HOT 1
- FYI: Added TypeScript declarations for restify-plugins 1.5 HOT 1
- Test for 'metrics' not show existing bug HOT 2
- audit.test.js and audit.js have a bugs
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 plugins.