Skip to content

Instantly share code, notes, and snippets.

@emir
Created December 26, 2015 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emir/5b9a815f382629825c50 to your computer and use it in GitHub Desktop.
Save emir/5b9a815f382629825c50 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'nokogiri'
require 'json'
require 'sinatra/default_charset'
register Sinatra::DefaultCharset
set :default_charset, 'utf-8'
require_relative 'ttnetmuzik.rb'
ttnet = TTNETMuzik.new(Nokogiri, JSON)
get '/albums/:id/:name' do |id, name|
content_type :json
return ttnet.getAlbums(id, name).to_json
end
get '/songs/:id/:name' do |id, name|
content_type :json
return ttnet.getSongs(id, name).to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment