Code Monkey home page Code Monkey logo

phant-manager-http's Introduction

Phant is No Longer in Operation

Unfortunately Phant, our data-streaming service, is no longer in service and has been discontinued. The system has reached capacity and, like a less-adventurous Cassini, has plunged conclusively into a fiery and permanent retirement. There are several other maker-friendly, data-streaming services and/or IoT platforms available as alternatives. The three we recommend are Blynk, ThingSpeak, and Cayenne. You can read our blog post on the topic for an overview and helpful links for each platform.

All secondary SparkFun repositories related to Phant have been archived and pulled in as a subtree in the main Phant GitHub repository.


phant-manager-http Build Status

express based manager module for phant

Using phant-manager-http with phant

This section outlines how to quickly get this package up and running with the phant module.

Configure

  • open: https://data.sparkfun.com/config
  • under Add Manager select HTTP. This will add a new section below called Manager - HTTP
  • modify any other settings you desire. Likely this is OK as-is to get started
  • select Download Package. Avoid Publish to NPM unless you know what you are doing.
  • unpack the downloaded package

Install

  • go to the package you downloaded: cd phantconfig-custom.
  • do: npm install

Run

This example assumes you configured the module to use port 8080. If you have changed the HTTP port, replace 8080 with the port you chose.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 SparkFun Electronics. Licensed under the GPL v3 license.

phant-manager-http's People

Contributors

bboyho avatar d1runberg avatar dpjanes avatar randykarels avatar toddtreece avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phant-manager-http's Issues

Streams Meta

Issue:
You have a stream publicKey. You'd like to know what it's all about, specifically the metadata, the location, the fields - even, "does it exist"

Solution:
Add a new route

/stream/:publicKey/meta[.ext]

Which returns the meta data info. If the stream is public, the info is returned. If the stream is hidden, the phant-private-key field must be set, otherwise 403 forbidden should be returned.

(I am willing to code this)

What is the most effective way to add 3rd party libraries

In my attempt to add plotting to let folks see the data over time better I was trying to add in D3.js and Rickshaw.js (and it's supporting css) I noticed that all of the css and javascript in this project is concatenated into one file. Makes sense during production but it makes adding in new libraries and maintaining the ones in it a complete pain.

What would you suggest the most effective/maintainable method to bring them in is?

Support for JSON PATCH on update

Issue:
Updating the metadata with JSON POST is (1) really not RESTy (2) blanks out data not in the post. It would be nice to be able to update only certain named fields.

Background:
HTTP 'PATCH' is similar to PUT except that only fields sent should be updated.
http://tools.ietf.org/html/rfc5789

Solution:
routes.update should detect PATCH and default data as needed.

(I am willing to code this)

Getting a " '.' is not recognized as an internal or external command" during installation.

I am getting this error after running "$ NPM Install" . It is throwing an error on the line "./node_modules/bowers/bin/bower install && ./.bin/build".

I am running on windows 7 and I am reasonably sure that the problem is due to the path syntax used. I can't seem to figure out the correct path to get bower to run the build file. Any help would be appreciated.

How to get this running with phant?

I'm sure I just need to RTFM but I'm not sure where to start. I previously installed phant with npm install -g phant and it's working fine. I would now like to try the manager, and the readme says to use npm install phant-manager-http, but I'm not sure what the expected result is. If I run that command in the same directory where I run phant (the one that contains phant_streams), it installs the manager into node_modules, but starting phant after that results in no noticeable difference (i.e. /streams still just returns "phant is ready and listening for input").

Am I setting this up correctly, and how do I use the manager once it's installed?

Stream Description File

Background:

When a new stream is created, you are brought to you a page that describes the public key, the private key and so forth. There's also an option to email this to yourself.

Issue:

To use this data, typically one will copy each field somewhere else using cut and paste. This is rather tedious.

Proposed solution:

A new URL be made available

https://data.sparkfun.com/streams/<public>/keys/<private>

This will return a JSON record that looks like this (possibly with some other fields)

{
    "public_url": "https://data.sparkfun.com/output/<public>",
    "public_key": "###",    
    "private_key": "###",   
    "delete_key": "###"
}

The following HTTP headers will be returned

Content-Type: application/json
Content-Disposition: attachment; filename="<public_key>.json"

(Note: I'm willing to help out coding)

Error: EMFILE

Hi.

It looks like a lammer is downloading a .csv file too many times of a stream in my server.
This generates this error when I try to access any page:

Error: EMFILE: too many open files, scandir '/usr/local/lib/node_modules/phant/node_modules/phant-manager-http/views/partials'
at Error (native)

Is there a way to limit the time between downloads? At the moment I'll increase my ulimit -n

Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.