Book Image

Sails.js Essentials

By : Shahid Shaikh
Book Image

Sails.js Essentials

By: Shahid Shaikh

Overview of this book

<p>Sails.js makes it easy to build custom, enterprise-grade Node.js apps. It is designed to emulate the familiar MVC pattern of frameworks, but with support for the requirements of modern apps: data-driven APIs with a scalable, service-oriented architecture.</p> <p>This book will provide practical examples to get you started with Sails.js and get you develop production-ready apps in no time. We will take you from a Node.js web server and single threading system to a general MVC architecture. You will then learn to develop applications that you might be already familiar with using Sails.js. Finally, we will show you how to create a chat app and a to-do application, and improve code quality using JSHINT and JSCS.</p>
Table of Contents (15 chapters)
Sails.js Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Running the application


To run the application, open the terminal and run the following command:

sails lift

Now, we can visit our application at http://localhost:1337/, as shown in the following image:

To add a new message, you need to add the name or leave it as it is and type your message as shown in the following screenshot:

Now, let's test the socket broadcasting. Open two windows and send messages one after another, as shown in the following image: