feathersjs mysql login code example

Example: feathersjs mysql login

<!-- public/index.html -->
    <html>
      <head>
        <title>Welcome to Feathers</title>
        <link
          rel="stylesheet"
          href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.0/css/bootstrap.min.css"
          integrity="sha384-PDle/QlgIONtM1aqA2Qemk5gPOE7wFq8+Em+G/hmo5Iq0CCmYZLv3fVRDJ4MMwEA"
          crossorigin="anonymous"
        />
      </head>
      <body>
        <main class="container">
          <img
            class="logo"
            src="svg"
            alt="Feathers Logo"
          />
        </main>
        <div class="card mt-5">
            <div class="card-header">
              Messages
            </div>
            <div class="card-body">
              <h5 class="card-title">Send Message</h5>
              <input class="form-control" type="text" placeholder="message" id="message"/>
              <button onclick="sendMessage()" type="button" class="btn btn-primary mt-2">
                  Send Message
                </button>
            </div>
          </div>
      <div>

    </div>

        <script src="//cdn.rawgit.com/feathersjs/feathers-client/v1.0.0/dist/feathers.js"></script>
        <script src="socket.io/socket.io.js"></script>
        <script type="text/javascript">
          var socket = io()
          var app = feathers()
          app.configure(feathers.socketio(socket))
          var messages = app.service('message')

          messages.on('created', function(message){
            console.log('Message created on client', message)
          } )
          function sendMessage(){
            var messageText = document.getElementById('message').value;
            messages.create({text: messageText})
          }
        </script>
      </body>
    </html>

Tags:

Misc Example