soixantecircuits / bifrost Goto Github PK
View Code? Open in Web Editor NEWA cache gateway for posting in the past
Home Page: http://soixantecircuits.fr
A cache gateway for posting in the past
Home Page: http://soixantecircuits.fr
Some post requests that works on the master branch seems to fail on nedb-migration-feature with no error, just proxy.js - fail - but saved
the request was made in meteor like this:
request.post({url: url, formData: formData}, function optionalCallback (err, httpResponse, body) {...})
At startup bifrost should declare it's service and broadcast a bifrost service with port information.
This would allow other apps to seamlessly connect to bifrost if needed and post the content to save it
running npm test
proxy.js - launchRequest: http://46.101.182.71/api/item/
/Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:331
length = nativeMax(args.length - start, 0),
^
RangeError: Maximum call stack size exceeded
at max (native)
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:331:20
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:840:18
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/app/queue.js:42:9
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:3781:7
at Object.q.process (/Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:2127:19)
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:2076:17
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:338:29
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/node_modules/async/dist/async.js:840:18
at /Volumes/Macintosh HD/Users/gabrielstuff/Sources/node/bifrost/app/queue.js:42:9
npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/gabrielstuff/.nvm/versions/v5.12.0/bin/node" "/Users/gabrielstuff/.nvm/versions/v5.12.0/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node $NODE_DEBUG_OPTION app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node $NODE_DEBUG_OPTION app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bifrost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node $NODE_DEBUG_OPTION app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bifrost
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bifrost
npm ERR! There is likely additional logging output above.
Instead of considering only one type of posting, bifrost should care for :
Content-Type: multipart/form-data
Content-Type: application/x-www-form-urlencoded
Content-Type: raw
Content-Type: binary
Content-Type: binary
Content-Type: application/json
Simple POST script test could reflect the corresponding case
The reason why the post failed should be indicate : network issue or remote server error
Set bodyparserLimit
in option config.
when sending a base64 image like this: $http.post(url, base64)
bifrost shows unexpected token d
hotfix was to use $http.post(url, {"formData": data})
Currently the front does not show the reason for a POST failure. The front should display all the errors met while trying to post content to the remote URI.
Instead of :
if (!postData.timestamp) postData.timestamp = timestamp
We should :
postData.timestamp = timestamp || new Date()
The same principle should apply for every field.
bifrost 0.0.1 is running on http://192.168.8.102:3002
queue.js - clear timer
proxy.js - post from proxy
proxy.js - launchRequest: http://10.196.60.41:3000/api/storeMedia
proxy.js - fail - but saved
proxy.js - post from proxy - queue
proxy.js - launchRequest: http://10.196.60.41:3000/api/storeMedia
queue.js: all requests have been processed
proxy.js - post from proxy - queue
proxy.js - launchRequest: http://10.196.60.41:3000/api/storeMedia
queue.js: all requests have been processed
proxy.js - success + deleted
proxy.js - success + deleted
queue.js - clear timer
and I can see the image twice on the server
Line 34, we use JSON.parse without try catch.
https://github.com/soixantecircuits/bifrost/blob/master/app/proxy.js#L34
This is error prone and should be avoid.
We need to test if a one day connection issue could be properly handle. This means around 1000 posts that should be queued.
Thanks !
The port, line 152, should be placed in the config file
The test folder should include :
A test script for each POST type
A test script that shows that the response from the server is well forwarded
A test script that shows that if the test server fail, bifrost return that it saved it
This would allow to:
The queue must be handled one file at a time and not every file at once.
On your interval, just take one file, then another :)
In order to avoid to replace custom config setup, add a config.example.json to make sure people are up to date.
Add the relevant info in readme : cp config/config.example.json config/config.json
5000
should be place in a var in the config file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.