Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-connect

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-connect

Start a connect web server

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
decreased by-80.16%
Maintainers
6
Weekly downloads
 
Created

What is grunt-contrib-connect?

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.

What are grunt-contrib-connect's main functionalities?

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
        }
      ]
    }
  }
}

Other packages similar to grunt-contrib-connect

Keywords

FAQs

Package last updated on 16 Jul 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc