Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const middleWareComms = require('./middleware-comms/index')
- window.submitNewUser = require('./User_Input/index').submitNewUser
- console.log('foo bar baz')
- middleWareComms.connect('ws://localhost:8181').then(async function(socket) {
- middleWareComms.send(socket, {type: 'createUser', username: 'testUser',
- password: 'pass', email: 'example@any.com'})
- middleWareComms.listen(socket, middleWareComms.dataHandeler)
- })
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <link rel='stylesheet' href='../css/index.css' />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <input type='text' id='username' placeholder='Username' />
- <input type='text' id='email' placeholder='Email' />
- <input type='password' id='password' placeholder='Password' />
- <input type='button' onclick='window.submitNewUser(document.getElementById("username"), document.getElementById("email"), document.getElementById("password"))' />
- <script type='text/javascript' src='../js/bundle.js'></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement