pass to 0.1.0 version

This commit is contained in:
Yann Esposito 2014-09-26 15:51:51 +02:00
parent f6c512f78d
commit 9ac0600019
2 changed files with 52 additions and 1 deletions

51
index.html Normal file
View file

@ -0,0 +1,51 @@
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
var murl="http://m4.vigiglo.be:3000/api";
function getMe(){
$.ajax(
{url: murl + "/resources/whoami"
, type: 'GET'
, success: function(data){alert(data)}
, error: function(data,status){alert("WHOAMI ERROR: " + status);}
});
}
function login(next){
$.ajax(
{url: murl + "/login"
, type: 'GET'
, data: {username: 'teser@test.com', password: 'test'}
, success: getMe
, error: function(data,status){alert("LOGIN ERROR: " + status);
next();
}
, xhrFields: { withCredentials: true }
, crossDomain: true
});
}
function argh(pref){
return function(data,status){
alert(pref + ": " + data.toString());
alert(pref + ": " + status.toString());
};
}
function logout(next){
$.ajax(
{url: murl + "/logout"
, type: 'GET'
, success: next
, error: argh("logout")
, xhrFields: { withCredentials: true }
, crossDomain: true
});
}
$(document).ready(function(){
logout( function(){login ( getMe )} );
});
</script>
</head>
<body>
HERE
</body>
</html>

View file

@ -1,4 +1,4 @@
(defproject fuck-cors "0.1.0-SNAPSHOT" (defproject fuck-cors "0.1.0"
:description "Fuck CORS and open all to everyone" :description "Fuck CORS and open all to everyone"
:url "http://github.com/yogsototh/fuck-cors" :url "http://github.com/yogsototh/fuck-cors"
:license {:name "MIT" :license {:name "MIT"