|
@@ -0,0 +1,113 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+
|
|
|
|
|
+<html>
|
|
|
|
|
+ <head>
|
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
|
+ <title>SampleREST</title>
|
|
|
|
|
+
|
|
|
|
|
+ <style>
|
|
|
|
|
+ body {
|
|
|
|
|
+ margin: 0px;
|
|
|
|
|
+ padding: 0px;
|
|
|
|
|
+ background: #222;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ font-family: sans-serif;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ h1 {
|
|
|
|
|
+ color: orange;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .container {
|
|
|
|
|
+ width: 60%;
|
|
|
|
|
+ margin-left: 10%;
|
|
|
|
|
+ margin-right: 10%;
|
|
|
|
|
+ margin-top: 40px;
|
|
|
|
|
+ margin-bottom: 40px;
|
|
|
|
|
+ padding-left: 10%;
|
|
|
|
|
+ padding-right: 10%;
|
|
|
|
|
+ padding-top: 20px;
|
|
|
|
|
+ padding-bottom: 20px;
|
|
|
|
|
+ border-radius: 20px;
|
|
|
|
|
+ border: 2px solid orange;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a {
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ transition: color 0.5s;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ a:hover {
|
|
|
|
|
+ color: gray;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+
|
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
|
+ document.addEventListener("DOMContentLoaded", () => {
|
|
|
|
|
+ const list_to_prepare = document.querySelector(".copy-from");
|
|
|
|
|
+ let home_location = document.location.toString();
|
|
|
|
|
+
|
|
|
|
|
+ if (home_location[home_location.length - 1] != "/") {
|
|
|
|
|
+ home_location += "/";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ list_to_prepare.childNodes.forEach(link => {
|
|
|
|
|
+ link.innerText = home_location + link.innerText;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+ </head>
|
|
|
|
|
+
|
|
|
|
|
+ <body>
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <h1>Hello!</h1>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ This is sample, super simple REST api for tutorial. It could
|
|
|
|
|
+ response in JSON, HTML and send You JSON response with data
|
|
|
|
|
+ sentnby data in HTTP body (POST) or by parameters given in
|
|
|
|
|
+ URL (GET).
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <ul class="container">
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="./get">/get</a> - This return You JSON with
|
|
|
|
|
+ data sent by URL parameters (GET).
|
|
|
|
|
+ </li>
|
|
|
|
|
+
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="./post">/post</a> - This return You JSON with
|
|
|
|
|
+ data sent by body of HTTP request (POST).
|
|
|
|
|
+ </li>
|
|
|
|
|
+
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="./sample">/sample</a> - This return You sample
|
|
|
|
|
+ static JSON.
|
|
|
|
|
+ </li>
|
|
|
|
|
+
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="./html-sample">/html-sample</a> - This return You
|
|
|
|
|
+ static HTML response.
|
|
|
|
|
+ </li>
|
|
|
|
|
+
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <a href="./plain-sample">/raw-sample</a> - This return You
|
|
|
|
|
+ static text/plain response.
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <h4>You can copy endpoints from list:</h4>
|
|
|
|
|
+
|
|
|
|
|
+ <ul class="copy-from">
|
|
|
|
|
+ <li>get</li>
|
|
|
|
|
+ <li>post</li>
|
|
|
|
|
+ <li>sample</li>
|
|
|
|
|
+ <li>html-sample</li>
|
|
|
|
|
+ <li>plain-sample</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </body>
|
|
|
|
|
+</html>
|