| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <!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>
|