Skip to content

Commit 91ae732

Browse files
committed
Refactor
1 parent 946e5c5 commit 91ae732

File tree

3 files changed

+49
-14
lines changed

3 files changed

+49
-14
lines changed

src/server/public/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<html>
22
<head>
33
<title>JSON Server</title>
4-
<link href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/flatly/bootstrap.min.css" rel="stylesheet">
4+
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
55
<link rel="stylesheet" href="stylesheets/style.css">
66
</head>
77
<body>
8-
<div class="container">
8+
<main class="container">
99
<p>
1010
<a href="https://github.com/typicode/json-server" class="logo">
1111
<img src="images/json.png">
@@ -54,13 +54,14 @@ <h4>Issues</h4>
5454
<p>Please go
5555
<a href="https://github.com/typicode/json-server/issues">here</a>.
5656
</p>
57+
</main>
5758

59+
<footer class="container">
5860
<hr>
59-
6061
<p>
61-
<i>To replace this page, create an index.html file in ./public, JSON Server will load it.</i>
62+
To replace this page, create an index.html file in ./public, JSON Server will load it.
6263
</p>
63-
</div>
64+
</footer>
6465

6566
<script src="https://unpkg.com/mithril/mithril.min.js"></script>
6667
<script src="main.js"></script>

src/server/public/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ m.mount(
3333
view: function () {
3434
return [
3535
m('p', 'And the custom routes:'),
36-
m('ul', Object.keys(rules).map(function (rule) {
37-
return m('li', rule + ' → ' + rules[rule])
36+
m('table', Object.keys(rules).map(function (rule) {
37+
return m('tr', [
38+
m('td', rule),
39+
m('td', '⇢ ' + rules[rule])
40+
])
3841
}))
3942
]
4043
}
Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
1-
a {
2-
color: #1882BC !important;
1+
html {
2+
height: 100%;
3+
}
4+
5+
body {
6+
min-height: 100%;
7+
display: flex;
8+
flex-direction: column;
9+
}
10+
11+
main {
12+
flex: 1;
13+
padding: 2rem 0;
14+
}
15+
16+
a, a:hover {
17+
color: #1882BC;
18+
text-decoration: underline;
19+
}
20+
21+
table {
22+
margin-left: 30px;
23+
}
24+
25+
td {
26+
border: 0;
27+
}
28+
29+
td:first-child {
30+
width:1%;
31+
white-space:nowrap;
32+
color: #1882BC;
333
}
434

535
img {
636
padding-top: 50px;
737
padding-bottom: 20px;
838
}
939

10-
li {
11-
list-style-type: square;
40+
ul {
41+
list-style-position: inside;
42+
padding-left: 30px;
1243
}
1344

14-
h4 {
15-
padding-top: 20px;
16-
}
45+
li {
46+
list-style-type: none;
47+
}

0 commit comments

Comments
 (0)