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

simple-json-replay-server

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-json-replay-server - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

app_mock/example.4.json

0

.vscode/launch.json

@@ -0,0 +0,0 @@ {

// Place your settings in this file to overwrite default and user settings.
{
}

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

2

package.json
{
"name": "simple-json-replay-server",
"version": "0.0.11",
"version": "0.0.12",
"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.",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -127,2 +127,3 @@ # 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/)

data | a json object map | Yes | you can define the expected json response.
html | a string | Yes | When you define **html** as response, please note that you should not define **data**, if both **data** & **html** are defined, it will consider only **data**.

@@ -248,2 +249,3 @@

0.0.10 | Include **body** mapping for **json body** (application/json) & **form-urlencoded** (application/x-www-form-urlencoded)
0.0.11 | support filtering by **headers** value.
0.0.11 | support filtering by **headers** value.
0.0.12 | support new response type as **html**

@@ -67,6 +67,13 @@ var express = require('express');

function response(res, mockDataConfig) {
res.header("Content-Type", "application/json")
.status(mockDataConfig.response.status)
.json(mockDataConfig.response.data);
if(mockDataConfig.response.data) { //json data
res.header("Content-Type", "application/json")
.status(mockDataConfig.response.status)
.json(mockDataConfig.response.data);
} else { //assume it is html data
res.header("Content-Type", "text/html")
.status(mockDataConfig.response.status)
.send(mockDataConfig.response.html);
}
}

@@ -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 @@ var _ = require('underscore');

@@ -0,0 +0,0 @@ var chokidar = require('chokidar');

@@ -0,0 +0,0 @@ var assert = require('assert');

@@ -0,0 +0,0 @@ var assert = require('assert');

@@ -0,0 +0,0 @@ var assert = require('assert');

@@ -0,0 +0,0 @@ var assert = require('assert');

@@ -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

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