Comments (3)
This task is a wrapper to https://github.com/senchalabs/connect. It is possible but a bit out of the scope of the documentation of this task. We just explain how to setup your own middleware. At that point you should refer to the connect documentation for more info on configuring middleware.
Although here is an example in the direction of what you're after:
connect: {
dev: {
options: {
middleware: function(connect, options) {
return [
function(req, res) {
res.setHeader('Content-Type', 'text/cache-manifest');
res.end('hello!\n');
},
connect.static('basefolder/')
];
}
},
}
}
from grunt-contrib-connect.
I completely agree with your analysis and thanks a lot for the example. As someone who doesn't have a node background, it took me a while to realize that this plugin was just leveraging another tool called "connect" although that's obvious in hindsight.
from grunt-contrib-connect.
I have the same problem, I need to serve files without extension as text/html
from grunt-contrib-connect.
Related Issues (20)
- Can this connect from a remote server to either the web or to my local machine?
- ExperimentalWarning: The http2 module is an experimental API. HOT 6
- forwarding grunt connect to different url HOT 2
- DES3 is a weak cipher
- warning corifeus-builder-angular > grunt-contrib-connect > [email protected]: Use the built-in module in node 9.0.0 or newer, instead HOT 10
- Can I force TLS 1.2? HOT 2
- Can we use this with helmet? HOT 1
- Changing content type of files HOT 2
- Is it possible to configure the mime type returned by grunt-contrib-connect? HOT 1
- Options are just being ignored HOT 1
- This project's build is currently broken. HOT 1
- How to preview a Markdown file?
- Port parameter passed in as string leads to misleading error HOT 1
- Upgrade morgan package, CVE-2019-5413
- Cannot access Angular App hosted on CentOS 7 VM in Windows 10
- Security vulnerability GHSA-6fc8-4gx4-v693 affecting "ws" package (nested dependency) HOT 2
- opn dependency was renamed to `open` HOT 1
- `node-http2` is deprecated. Use node's built in `http2` HOT 6
- Fix vulnerability from websocket dependency: Denial of Service HOT 2
- IPv4 loopback overridden
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 grunt-contrib-connect.