Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
givanse committed Jan 4, 2019
1 parent b2f6df2 commit eb06984
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 1,933 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bower_components
node_modules
coverage*
coverage*
dist
src/pretender.es.js
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ with an express/sinatra style syntax for defining routes and their handlers.
Pretender will temporarily replace native XMLHttpRequest and Fetch , intercept
all requests, and direct them to little pretend service you've defined.

**:warning: Pretender only works in the browser!**

```javascript
const PHOTOS = {
"10": {
Expand All @@ -38,7 +40,13 @@ const server = new Pretender(function() {
$.get('/photos/12', {success() => { ... }})
```
## Usage examples
## Usage
```
yard add -D pretender
# or
npm install --save-dev pretender
```
You can load Pretender directly in the browser.
Expand All @@ -53,8 +61,6 @@ import Pretender from 'pretender';
const server = new Pretender(function() {});
```
Full example: [use-pretender-as-a-module](https:/givanse/use-pretender-as-a-module)
## The Server DSL
The server DSL is inspired by express/sinatra. Pass a function to the Pretender constructor
that will be invoked with the Pretender instance as its context. Available methods are
Expand Down
Loading

0 comments on commit eb06984

Please sign in to comment.