grunt-jads

0.1.0 • Public • Published

grunt-jads

Spin up a simple node.js http server enablding alias' and proxying requests. This grunt task is a wrapper to JADS (https://github.com/bocallaghan/JADS).

Getting Started

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-jads --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-jads');

The "jads" task

Overview

In your project's Gruntfile, add a section named jads to the data object passed into grunt.initConfig().

grunt.initConfig({
  jads: {
    options: {
      // Task-specific options go here.
    },
  },
});

Options

options.port

Type: String Default value: '8080'

A string value to specify the server port to listen on.

options.document_root

Type: String Default value: '.'

A string value to specify the document root of the web server.

options.alias

Type: Object Default value: nil

An object containing url alias names with a target diretory.

Usage Examples

Default Options

In this example, the default options are used to start a web server on localhost:8080 with content served from the current directory.

grunt.initConfig({
  jads: {
    options: {
    },
  },
});

Custom Options

In this example, custom options are used to specify port 8080; the current directory as the document root and a url alias pointing 'sapui5' to a fixed location on the PC.

grunt.initConfig({
  jads: {
    options: {
      port: "8080",
		  document_root: ".",
		  alias: {
		    "sapui5": "C:\\MyScratchFolder\\apache-tomcat-7.0.40\\webapps\\sapui5\\latest"
		  }
    },
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-jads

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • js1972