Socket.IO Real-time Web Application Development by Socket Io Real Time Web Application Development 2013
Author:Socket Io Real Time Web Application Development 2013
Language: eng
Format: epub
Publisher: Packt Publishing
In the following line of code, we are using Jade's functionality to append content to a block in an inherited template from the child element. This is done using the append keyword. The syntax is as follows:
block append <blockname>
The shorter form is as follows:
append <blockname>
The next two lines of code add the script tags by adding socket.io.js and chat.js to our page. You might be wondering where the /socket.io/socket.io.js file comes from, since we neither add it and nor does it exist on the filesystem. This is part of the magic done by io.listen on the server. It creates a handler on the server to serve the socket.io.js script file.
And we are ready. Restart the node server and browse to http://localhost:3000 / to open the chat room. You will see the welcome message, Welcome to the most interesting chat room on earth!, being displayed in the message area.
To see how our chat application works, open it in two separate browser instances. Now you can enter your message in the message box in one of the browsers and click Send. You will see it appear on the message area of both the browsers.
Congratulations! We now have a chat room. If you deploy it to a server or allow access to port 3000 on your system, you can invite your friends to chat.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25281)
Hello! Python by Anthony Briggs(24333)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23419)
Kotlin in Action by Dmitry Jemerov(22503)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21956)
Dependency Injection in .NET by Mark Seemann(21836)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20702)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19515)
Grails in Action by Glen Smith Peter Ledbrook(18594)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17028)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15836)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13683)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11848)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11149)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9185)
The Kubernetes Operator Framework Book by Michael Dame(8560)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8400)
Robo-Advisor with Python by Aki Ranin(8356)