Code Monkey home page Code Monkey logo

spotifytokenswap's Introduction

Spotify Token Swap Service for Heroku

To use the new Spotify SDK we are required to run our own Token Exchange Service. This repository provides you with an easy installation on Heroku. The current CLIENT_ID, CLIENT_SECRET and CLIENT_CALLBACK_URL are straight from Spotifys Repo and work with their example apps.

Setup

Unless you are expecting massive traffic, the free plan will work for you. Be patient, it can take up to 60 min until you get the confirmation Mail from Heroku.

git clone https://github.com/simontaen/SpotifyTokenSwap.git
cd SpotifyTokenSwap

From here on forward it's basically following the Getting Started Guide.

heroku create --http-git
git push heroku master
heroku ps:scale web=1
heroku logs --tail
  • Verify its running
curl https://peaceful-sierra-1249.herokuapp.com

and you should get a <h1>Not Found</h1> back. Also check the logs should show something like

app[web.1]: ip-10-147-165-35.ec2.internal - - [<timestamp>] "GET / HTTP/1.1" 404 18
app[web.1]: - -> /
app[web.1]: <your-ip> - - [<timestamp>] "GET / HTTP/1.1" 404 18 0.0005
heroku[router]: at=info method=GET path="/" host=peaceful-sierra-1249.herokuapp.com <...>

Or run the Spotify examples with a corrected kTokenSwapServiceURL and kTokenRefreshServiceURL.

  • Your own app

As mentioned above the current code is configured to what Spotify provided us. So you need to syncronize the CLIENT_ID, CLIENT_SECRET and CLIENT_CALLBACK_URL between your Spotify Account, your iOS App and the spotify_token_swap.rb.

Run Locally

bundle install
foreman start

foremanis part of the Heroku Toolbelt.

Convenience

I personally will host an instance on Heroku for public use as it is very annoying to go through setting everything up when you just want to try something with the SDK. I'll keep it on the free plan and won't pay much attention to it. We'll see how it goes but if the service it getting slammed it'll crash, so be polite.

https://peaceful-sierra-1249.herokuapp.com/swap
https://peaceful-sierra-1249.herokuapp.com/refresh

spotifytokenswap's People

Watchers

 avatar  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.