JSFiddle - React, Tailwind, and code Playground
by Zareh Geertjes
HTML
<script src="http://sandbox.edskeizer.nl/jquery.base64.js"></script>
CoffeeScript
auth =
username: "[email protected]"
password: "testtest"
success: (info) ->
console.log info
error: (error) ->
console.log error
$ ->
$.ajax
type: "GET"
url: "http://dev.api.getlumio.com/_users/org.couchdb.user:[email protected]"
contentType: "application/json; charset=utf-8"
beforeSend: (xhr) ->
xhr.setRequestHeader "Authorization", "Basic " + $.base64.encode(auth.username + ":" + auth.password)
return
dataType: "json"
success: auth.success
error: auth.error