rust-online-compiler/web-server/static/index.html
2024-10-17 01:08:56 +08:00

25 lines
624 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rust Online Compiler</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<h1>Rust Online Compiler</h1>
<textarea id="code" rows="10" cols="50"></textarea><br/>
<button onclick="compile()">Compile</button>
<pre id="output"></pre>
<script>
function compile() {
const code = document.getElementById('code').value;
axios.post('/compile', { code })
.then(response => {
document.getElementById('output').textContent = response.data.result;
});
}
</script>
</body>
</html>