-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.ejs
102 lines (93 loc) · 2.45 KB
/
index.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<html>
<head>
<title>JSON Server</title>
<link rel="shortcut icon" href="favicon.ico">
<link href="main.css" rel="stylesheet">
</head>
<style>
h4 {
margin-bottom: 10px;
margin-top: 10px;
}
p {
margin-bottom: 4px;
margin-top: 4px;
}
</style>
<body>
<header>
<div class="container">
<h3>JSON Server</h3>
</div>
</header>
<main>
<div class="container">
<h4>Congrats!</h4>
<p>
You're successfully running <b>a modified</b> JSON Server
<br> ✧*。٩(ˊᗜˋ*)و✧*。
</p>
<h4>Important!</h4>
<p>
This is a <em>specialized version of <a href="https://github.com/typicode/json-server">json-server</a></em>,
created solely as a server
meant for exercises at kea.dk - computer science 3. semester
</p>
<h4>What's different</h4>
<ul style="margin-top: 0px;">
<li>- This version provides json formatted error responses for invalid requests</li>
<li>- This version generates, at random, errors that will lead to a status-code 500 responses</li>
<li>- It's hard-coded to provide rules for new Users. Rules used before storing new Users:
<ul>
<% for(r in rules) {%>
<li><b style="margin-right:5px;">
<%= r %>
</b>
<%= JSON.stringify(rules[r]) %>
</li>
<% } %>
</ul>
</li>
</ul>
<h5>Error Format</h5>
All errors are reported in json, in a format as sketched below:
<p>
<code>
{
status : 404, "msg": "No content found for this request"
}
</code>
</p>
<h4>Resources</h4>
<a href="<%= url %>">
<%= resourse %>
</a>
<p>
To access and modify resources, you can use any HTTP method
<br>
<code>GET</code>
<code>POST</code>
<code>PUT</code>
<code>PATCH</code>
<code>DELETE</code>
<code>OPTIONS</code>
</p>
<div id="custom-routes"></div>
<h4>Documentation</h4>
<p>
View
<a href="https://github.com/typicode/json-server">README</a>
</p>
</div>
</main>
<footer>
<div class="container">
<p>
To replace this page, create a
<code>./public/index.html</code> file.
</p>
</div>
</footer>
<script type="text/javascript" src="main.js"></script>
</body>
</html>