Giter Club home page Giter Club logo

christmas-jumper's Introduction

Christmas Jumper API

A Node.js server + microphone collecting HTML page that detects songs, and returns various festive themed iconography.

Running

First, make sure you npm install.

Browsing to the root of the webserver on http://localhost:12271 will take you to the audio capture page.

You can start the app by running npm start.

> npm start

> [email protected] start C:\dev\christmas-jumper
> node server.js

Your app is listening on port 12271

If you want to develop against this with hot-reload and debugging enabled, first, make sure you've installed nodemon

> npm install -g nodemon

then you can simply run npm run devserver

> npm run devserver

> [email protected] devserver C:\dev\christmas-jumper
> nodemon --inspect server.js

[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node --inspect server.js`
Debugger listening on ws://127.0.0.1:9229/5ce30222-84d5-4b69-81bd-23a6b1647594
For help, see: https://nodejs.org/en/docs/inspector
Your app is listening on port 12271

This will run the server on the same port, with --inspect enabled to connect VSCode or WebStorm debuggers to step through the code. It'll also hot-reload any javascript changes, so you don't have to cycle your node process during dev.

Testing

Requires jest. You probably want to

> npm install -g jest

and restart your terminal for this to work well.

From the command line, run npm test (or just jest) - to run the entire test suite.

> npm test

> [email protected] test C:\dev\christmas-jumper
> jest

 PASS  commands/SongDetector.test.js (5.092s)
  Song detector
    √ Execute returns song title from AudD API call. (2ms)
    √ Execute calls AudD with API token from configuration
    √ Execute instructs AudD to download song from azure blob storage
    √ Integration test: Can detect song that we know about when run against the real AudD API (3952ms)

Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        5.741s
Ran all test suites.

Or use your favourite jest supporting tool.

Usage

Just open your browser!

Configuration

Configuration for Azure storage buckets and AudD API keys is stored in config.js.

christmas-jumper's People

Contributors

thisisjofrank avatar davidwhitney avatar

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.