The Dart VM can also run as a server application on the command line or as a background job. While creating the application, choose the command-line application template. Most of Dart's server functionality lives in the dart:io
library, which cannot be used in writing browser Dart apps; in the same way, dart:html
cannot be used on the server. The HttpServer
class is used to write Dart servers; a server listens on a particular host and port for incoming requests and provides event handlers (also called request handlers) that are triggered when a request with incoming data from a client is received. The latter is described by the HttpRequest
class, which is an asynchronous API provided by the browser (formerly known as Ajax) and has properties, such as method, path, query parameters, and InputStream
with the data. The server responds by writing to OutputStream
of an HttpResponse
object. The following is the code of the webserver
project, where you can easily see all the parts...
Learning Dart, Second Edition - Second Edition
By :
Learning Dart, Second Edition - Second Edition
By:
Overview of this book
Table of Contents (18 chapters)
Learning Dart Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Dart – A Modern Web Programming Language
Getting to Work with Dart
Structuring Code with Classes and Libraries
Modeling Web Applications with Model Concepts and Dartlero
Handling DOM in a New Way
Combining HTML5 Forms with Dart
Building Games with HTML5 and Dart
Developing Business Applications with Polymer Web Components
Modeling More Complex Applications with dartling
Local Data and Client-Server Communication
Data-Driven Web Applications with MySQL and MongoDB
Index
Customer Reviews