Git Product home page Git Product logo

robokitty's Issues

✨Help & Questions ✨

Please direct any questions that don't require a pull request to the comments under this post. I'll try my best to answer them!

Consider throwing or process.exit'ing if required vars are not supplied

On https://github.com/rachelnicole/robokitty/blob/master/app.js#L10-L11

You definitely want someone to put that data in there. Since they're required (and the defaults are invalid) you might not want to do the shortcircuit || operator, but rather check to see if those variables are undefined and if they are print out usage instructions:

var token = process.env.PARTICLE_KEY
var deviceId = process.env.PHOTON_ID

if (!token || !deviceId) {
   console.log('You need to provide your PARTICLE_KEY and PHOTON_ID as environment variables before running this command')
   console.log('Ex: PARTICLE_KEY=test PHOTON_ID=test node app.js')
   process.exit()
}

(Or you could throw too, if app.js is ever require'd by another module, calling process.exit is a pretty rude thing to do to the including program :))

Hapi static assets

I can't test this because I I don't have my Photon handy, but you could replace those four existing Hapi routes in lib/server.js with this one route to handle the static content in that public directory:

    server.route({
      method: 'GET',
      path: '/{param*}',
      handler: {
        directory: {
          path: 'public',
          listing: false,
          index: true
        }
      }
    });

It should basically work the same way, but I'm making the assumption that you just want to serve up that content and that it isn't required to link directly to your image assets.

Probably don't need attachEvent

Super minor... I see that you're using attachEvent, but not ensuring existence of window.console. Probably, if you're doing one, you should do both - but I'd guess you could just skip the attachEvent check? Is this necessary anywhere but IE8?

Arduino Support

People may not want to leave this app running on their computer 24/7.
We could set the app up to run on a Raspberry Pi or Arduino that sits on the user's local network so that they don't have to!

Acceptance Criteria:

  • remove hardcoded references to localhost:3000 in public/index.html and public/robokitty.js
  • write a chef/ansible/salt script for deployment or use docker
  • update documentation for deploy process
  • add hardware to the list, marked as 'optional'

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.