blob: 800bc5cf8db6a90aa78a6d3bbbd6c815eb70321e [file] [log] [blame]
<!DOCTYPE html>
<!-- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file. -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>index</title>
<link rel="icon" href="favicon.ico">
<script defer src="index.dart.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap" rel="stylesheet">
<style>
#code {
font-family: 'Roboto Mono', monospace;
}
</style>
</head>
<body>
<h1>API Tester</h1>
<br />
<table>
<tr>
<td width = "100px"></td>
<td width = "500px">
<pre id="code" contentEditable="true">
main() {
print(primesLessThan(15));
}
// Computes primes less than [n] using the Sieve of Eratosthenes.
primesLessThan(n) {
var l = new List.generate(n, (i) =&gt; i);
for (int i = 2; i * i &lt; n; i++)
if (l[i] != null)
for (int j = i * i; j &lt; n; j += i)
l[j] = null;
return l.skip(2).where((i) => i != null);
}
</pre>
</td>
</tr>
</table>
<input type="text" id="apiEndPoint"
value="http://localhost:8082/api/dartservices/v2/analyze"
size="64" />
<button id="sendButton">Send</button>
<hr />
<pre id="perf">Perf</pre>
<pre id="output">Output</pre>
</body>
</html>