Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
grunt-contrib-connect
Advanced tools
grunt-contrib-connect is a Grunt plugin that provides a simple web server for serving static files. It is commonly used in development workflows to serve files, enable live reloading, and proxy requests to other servers.
Serve Static Files
This feature allows you to serve static files from a specified directory. In this example, the server runs on port 9000 and serves files from the 'public' directory.
json
{
"connect": {
"server": {
"options": {
"port": 9000,
"base": "public"
}
}
}
}
Live Reload
This feature enables live reloading of the web page when files change. The server is configured to use live reload, and the watch task monitors changes in the 'public' directory.
json
{
"connect": {
"server": {
"options": {
"port": 9000,
"base": "public",
"livereload": true
}
}
},
"watch": {
"options": {
"livereload": true
},
"files": [
"public/**/*"
]
}
}
Proxy Requests
This feature allows you to proxy requests to another server. In this example, requests to '/api' are proxied to 'api.example.com' on port 80.
json
{
"connect": {
"server": {
"options": {
"port": 9000,
"base": "public",
"middleware": function(connect, options, middlewares) {
middlewares.unshift(require('grunt-connect-proxy/lib/utils').proxyRequest);
return middlewares;
}
},
"proxies": [
{
"context": "/api",
"host": "api.example.com",
"port": 80
}
]
}
}
}
http-server is a simple, zero-configuration command-line HTTP server. It is similar to grunt-contrib-connect in that it serves static files, but it is a standalone tool and does not require Grunt.
live-server is a simple development HTTP server with live reload capability. It is similar to grunt-contrib-connect's live reload feature but is a standalone tool that does not require Grunt.
browser-sync is a powerful tool for synchronizing browser testing. It provides live reloading, CSS injection, and synchronized browser testing. It offers more features compared to grunt-contrib-connect but can be used alongside Grunt.
FAQs
Start a connect web server
The npm package grunt-contrib-connect receives a total of 0 weekly downloads. As such, grunt-contrib-connect popularity was classified as not popular.
We found that grunt-contrib-connect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.