forked from cowboy/grunt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Grunt homepage](https://github.com/cowboy/grunt) | [Documentation table of contents](toc.md) | ||
|
||
# server (built-in task) | ||
Start a static web server. | ||
|
||
## About | ||
|
||
This task starts a static web server on a specified port, at a specified path, which runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. | ||
|
||
For more information on general configuration options, see the [configuring grunt](configuring.md) page. | ||
|
||
## Usage examples | ||
|
||
In this example, `grunt server` will start a static web server at `http://localhost:8000/`, with its base path set to the gruntfile's directory. Of course, it will then immediately stop serving files, because grunt exits automatically when there are no more tasks to run. | ||
|
||
The `server` task is most useful when used in conjunction with another task, like the [qunit](task_qunit.md) task. | ||
|
||
```javascript | ||
/*global config:true, task:true*/ | ||
config.init({ | ||
server: { | ||
port: 8000, | ||
base: '.' | ||
} | ||
} | ||
}); | ||
``` | ||
|
||
See the [server task source](https://github.com/cowboy/grunt/blob/master/tasks/server.js) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters