This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/backend/tmpfront/index.html

30 lines
725 B
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
Hello World
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript">
const host = location.origin.replace(/^http/, 'ws')
const ws = new WebSocket(host)
ws.onmessage = msg => console.log(msg.data)
ws.onopen = () => {
console.log('Hai')
ws.send('Ping') // Send the message 'Ping' to the server
}
2019-02-14 01:17:24 +00:00
console.log(JSON.stringify(document.cookie))
axios.post('/test',{
x: 123
})
.then( (response) => {
console.log(response)
})
</script>
</body>
</html>