simple-json-replay-server
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "simple-json-replay-server", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "A simple json replay server which can be used for standalone frontend web application (angular especially) when development. Simply put the url & parameters & response json data, then hit the url in browser or from your web application, whenever it matches the url and parameters, it will return the best match json data.", | ||
@@ -36,8 +36,8 @@ "main": "main.js", | ||
"underscore": "^1.8.3", | ||
"chokidar": "^1.6.1" | ||
"chokidar": "^1.6.1", | ||
"rx": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^3.2.0", | ||
"rx": "^4.1.0" | ||
"mocha": "^3.2.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # Simple JSON Replay Server ❤️ [![Build Status](https://travis-ci.org/realdah/simple-json-replay-server.svg?branch=master)](https://travis-ci.org/realdah/simple-json-replay-server) [![npm version](https://badge.fury.io/js/simple-json-replay-server.svg)](https://badge.fury.io/js/simple-json-replay-server) [![Node version](https://img.shields.io/node/v/simple-json-replay-server.svg?style=flat)](http://nodejs.org/download/) |
@@ -0,0 +0,0 @@ var express = require('express'); |
@@ -0,0 +0,0 @@ var _ = require('underscore'); |
@@ -0,0 +0,0 @@ var glob = require("glob"); //load many files and filtering with some rules at one shot |
@@ -0,0 +0,0 @@ function print(message, option) { |
var chokidar = require('chokidar'); | ||
var Rx = require( 'rx' ); | ||
var Rx = require('rx'); | ||
var mockDataLoader = require("./mockDataLoader"); | ||
var util = require("./util"); | ||
var log = console.log; | ||
function startWatching(folder) { | ||
@@ -15,18 +13,18 @@ | ||
//Only reload the files until user stops changing files after 800 milliseconds, to avoid repeat loading when saving/copying multiple files. | ||
var changedFiles = Rx.Observable.fromEvent( dirWatcher, 'change' ).debounce(function (x) { return Rx.Observable.timer(800); }); | ||
var changedFiles = Rx.Observable.fromEvent(dirWatcher, 'change').debounce(function (x) { return Rx.Observable.timer(800); }); | ||
var subscription = changedFiles.subscribe( | ||
function( filename ) { | ||
function (filename) { | ||
util.print("Change detected for mock data, reload..."); | ||
mockDataLoader.reset(); | ||
mockDataLoader.loadRequestMappings(folder); | ||
}, | ||
function( err ) { | ||
console.log( 'Error: ' + err ); | ||
}, | ||
function () { | ||
console.log( 'Completed' ); | ||
}); | ||
}, | ||
function (err) { | ||
console.log('Error: ' + err); | ||
}, | ||
function () { | ||
console.log('Completed'); | ||
}); | ||
} | ||
exports.startWatching = startWatching; | ||
@@ -0,0 +0,0 @@ var assert = require('assert'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25326
1
5
389