Socket
Socket
Sign inDemoInstall

iceflow-server

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iceflow-server - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

16

lib/HttpService.js

@@ -106,7 +106,13 @@ 'use strict';

const action = !req.testMode ? require('../../../server/api/actions/' + frags[0] + '/get' + file) : require('../tests/stubs/action')(req.testMode);
const requestData = {
url: (specOptions.api ? conf.apis[specOptions.api] : '/api') + specOptions.action
};
if(specOptions.data){
for(let n in specOptions.data){
requestData[n] = specOptions.data[n];
}
}
//create a synthetic for the action
const request = SyntheticRequest({
url : (specOptions.api ? conf.apis[specOptions.api] : '/api') + specOptions.action,
data: specOptions.data || {}
});
const request = SyntheticRequest(requestData);
//create the synthetic response, methods such as json() will resolve this promise

@@ -191,3 +197,3 @@ const response = SyntheticResponse();

var request = superagent
.get(action + (specOptions.data ? '?' + this.querify(specOptions.data) : ''))
.get(action + (specOptions.data && specOptions.data.query ? '?' + this.querify(specOptions.data.query) : ''))

@@ -194,0 +200,0 @@ if(specOptions.api){

@@ -30,3 +30,3 @@ 'use strict';

this.params = options.params || {};
this.query = this.getQueryData(options.data || location.search);
this.query = this.getQueryData(options.query ? options.query : (typeof location !== 'undefined' ? location.search : null));
this.body = {};

@@ -33,0 +33,0 @@

{
"name": "iceflow-server",
"version": "0.0.8",
"version": "0.1.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "directories": {

@@ -226,2 +226,23 @@ #Iceflow Server

For params and query data the fetch method has a data key. Example:
```javascript
const HttpsService = require('iceflow-server/lib/HttpService');
HttpService.fetch({
users: {
action: '/users/1',
data: {
params: {
id: 1
},
query: {
x: 2
}
}
}
}).then( data => {})
```
- get/post/put/patch/delete (object) - Crud methods take an object in the form {url: '/', data: {}, cors: false} and returns a promise.

@@ -228,0 +249,0 @@

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