tinywebdis - a lean webdis replacement using turbo.lua
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0KB

  1. <html>
  2. <head>
  3. <meta content='text/html; charset=utf-8' http-equiv='content-type'>
  4. <title>turbowebdis</title>
  5. <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'></script>
  6. <script type='text/javascript'>
  7. $(document).ready(function()
  8. {
  9. $('button').on('click', function()
  10. {
  11. $.ajax({
  12. 'type' : 'POST',
  13. 'dataType' : 'JSON',
  14. 'contentType' : 'application/json',
  15. 'url' : 'http://localhost:8888/',
  16. 'data' : JSON.stringify({"auth": "foobar", "db": 1, "command": ["SET", "SOME", "VALUE"]}),
  17. 'success' : function(response)
  18. {
  19. console.log(response);
  20. document.write(JSON.stringify(response));
  21. }
  22. });
  23. })
  24. });
  25. </script>
  26. </head>
  27. <body>
  28. <button>make request</button>
  29. </body>
  30. </html>