Giter VIP home page Giter VIP logo

soai-server's Introduction

Quickstart

To get required packages, run: npm install

To start the server, run: npm start

Note: This only starts the server app. Will still run even if the integrations are not set up, but will error if you try to make requests.

To use with soai app

Install this extension if you use Chrome, turn on when debugging, off when done debugging: https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc/related

idk if u use another browser.

Cyanite.ai Integration

This example app showcases how you can integrate the Cyanite.ai API into your own application.

Prerequisites

Before getting started you will need to create an integration over at https://app.cyanite.ai/integrations

You need the following:

  • Access Token
  • Webhook Secret

After receiving these copy .env.sample to .env and adjust the values.

Then you can install the dependencies using either yarn install (or npm install).

Starting the webhook listener

The script uses ngrok.io for exposing the port to the internet. This allows to make the webhook accessible from the Cyanite.ai servers for development purposes. In production environment you should not rely on ngrok.io but rather have a public facing server/service.

run yarn proxy-port (npm run proxy-port)

Wait until you see the following output (in case your port is already in use you will have to configure the port inside your .env file.)

yarn run v1.15.2
$ node src/proxy-port.js
Server listening on https://f288XXXX.ngrok.io/incoming-webhook

Copy the ngrok.io url and update your Cyanite.ai Integration Webhook Url to the given value. (You can use the test button to ensure that the requests arrive).

Please keep the proxy-port running.

run yarn start (or npm start)

Upload a new file

Run the src/file-upload.js script using yarn file-upload (or npm run file-upload).

yarn file-upload "./piano-sample.mp3"

Enqueueing a file analysis

Run the src/file-enqueue-analysis.js script using yarn file-enqueue-analysis (or npm run file-enqueue-analysis). The script will enqueue a file analysis. After a few seconds you should be able to see some output in the terminal of the webhook server.

yarn file-enqueue-analysis "<put-analysis-id-here>"

Further References

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.