X Tutup
Skip to content

Commit 3e75881

Browse files
committed
Add index.html
1 parent a088048 commit 3e75881

File tree

2 files changed

+139
-3
lines changed

2 files changed

+139
-3
lines changed

src/main/java/org/biojava/http/ServerMain.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ public class ServerMain {
4646

4747
public static void main(String[] args) {
4848
port(8080);
49-
50-
get("/", (r,r2) -> "BioJava HTTP");
49+
50+
staticFileLocation("/static");
51+
52+
// Document new routes in index.html
5153

5254
get(BioJavaRoutes.PDB, new PDBRoute());
5355

5456
get(BioJavaRoutes.MMCIF, new MMCIFRoute());
5557

5658
get(BioJavaRoutes.NGL, new NGLRoute(), new HandlebarsTemplateEngine());
57-
59+
5860
get(BioJavaRoutes.CESYMM, new CeSymmRoute(), new HandlebarsTemplateEngine());
5961
get(BioJavaRoutes.CESYMM_JSON, new CeSymmResultRoute(),new JsonTransformer());
6062
get(BioJavaRoutes.CESYMM_PDB, new CeSymmResultRoute() {
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset='utf-8'>
5+
<title>BioJava Webservices</title>
6+
<style type="text/css">
7+
body {
8+
background: gray;
9+
}
10+
11+
pre {
12+
margin: 0px auto;
13+
width: 100%;
14+
border: solid #ccc 1px;
15+
float: left;
16+
padding: 10px;
17+
position: relative;
18+
z-index: 10;
19+
}
20+
21+
pre:after {
22+
background-color: #ccc;
23+
content: '';
24+
display: block;
25+
position: absolute;
26+
left: 0px;
27+
top: 0px;
28+
width: 10px;
29+
height: 100%;
30+
z-index: -1;
31+
}
32+
33+
#main {
34+
max-width: 800px;
35+
background: white;
36+
margin: auto;
37+
padding: 25px;
38+
}
39+
40+
.route {
41+
width: 100%;
42+
}
43+
44+
.route td {
45+
width: 50%;
46+
padding-right: 25px;
47+
}
48+
.route td+td {
49+
padding-left: 25px;
50+
}
51+
52+
</style>
53+
</head>
54+
<body>
55+
<div id="main">
56+
<h1>BioJava Webservices</h1>
57+
<p>
58+
<a href="http://biojava.org">BioJava</a> is a powerful library of
59+
bioinformatics tools, but leveraging BioJava from web interfaces is
60+
challenging. This provides a number of APIs and pre-build interfaces
61+
for accessing BioJava through the browser.
62+
</p>
63+
<h2>biojava-structure</h2>
64+
<p>
65+
BioJava understands and can automatically fetch a wide variety of
66+
structure formats. In the following examples,
67+
<tt>:id</tt>
68+
can be replaced by any of the following:
69+
<ul>
70+
<li><b>PDB</b> PDB identifier, optionally followed by chain
71+
and/or residue ranges. Examples: 4hhb, 4hhb.A, 4hhb.A:1-50.</li>
72+
<li><b>SCOP</b> SCOPe domain. Example: d1h6w.2</li>
73+
<li><b>PDP</b> Protein Domain Parser domain. Example: PDP:4HHBAa</li>
74+
<li><b>CATH</b> Cath domains. Example: 1qvrC03</li>
75+
<li><b>ECOD</b> ECOD domain. Example: e1lyw.1
76+
<li><b>BIO</b> Biological assembly. Example: BIO:2ehz:1</li>
77+
</ul>
78+
</p>
79+
<h3>Fetching structures</h3>
80+
<p>
81+
<table class="route">
82+
<tr>
83+
<td><pre>/pdb/:id</pre></td>
84+
<td>Example: <a href="/pdb/1itb.A">/pdb/1itb.A</a></td>
85+
</tr>
86+
<tr>
87+
<td><pre>/mmcif/:id</pre></td>
88+
<td>Example: <a href="/mmcif/1itb.A">/mmcif/1itb.A</a></td>
89+
</tr>
90+
</table>
91+
Returns the requested structure in PDB or mmCIF format.
92+
</p>
93+
<h3>Viewing structures</h3>
94+
<p>
95+
<table class="route">
96+
<tr>
97+
<td><pre>/ngl/:id</pre></td>
98+
<td>Example: <a href="/ngl/1itb.A">/ngl/1itb.A</a></td>
99+
</tr>
100+
</table>
101+
Views the requested structure using <a
102+
href="https://github.com/arose/ngl">NGL</a>.
103+
</p>
104+
<h3>CE-Symm</h3>
105+
<p>
106+
<table class="route">
107+
<tr>
108+
<td><pre>/cesymm/:id</pre></td>
109+
<td>Example: <a href="/cesymm/1itb.A">/cesymm/1itb.A</a></td>
110+
</tr>
111+
</table>
112+
Analyze the structure for internal symmetry using <a
113+
href="https://github.com/rcsb/symmetry">CE-Symm</a>.
114+
</p>
115+
<p>Information about the alignment is available in several
116+
formats:
117+
<table class="route">
118+
<tr>
119+
<td><pre>/cesymm/:id/pdb</pre></td>
120+
<td>Example: <a href="/cesymm/1itb.A">/cesymm/1itb.A/pdb</a></td>
121+
</tr>
122+
</table>
123+
PDB file with a superposition of the structure.
124+
<table class="route">
125+
<tr>
126+
<td><pre>/cesymm/:id/json</pre></td>
127+
<td>Example: <a href="/cesymm/1itb.A/json">/cesymm/1itb.A/json</a></td>
128+
</tr>
129+
</table>
130+
JSON describing the alignment.
131+
</p>
132+
</div>
133+
</body>
134+
</html>

0 commit comments

Comments
 (0)
X Tutup