Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying DART Essentials
  • Table Of Contents Toc
  • Feedback & Rating feedback
DART Essentials

DART Essentials

By : Sikora
4.8 (4)
close
close
DART Essentials

DART Essentials

4.8 (4)
By: Sikora

Overview of this book

This book is targeted at expert programmers in JavaScript who want to learn Dart quickly. Some previous experience with OOP programming in other languages and a good knowledge of JavaScript are assumed.
Table of Contents (11 chapters)
close
close
10
Index

Using Dart as a full-stack language


For dynamic content, we could use Dart's HTTP server, but we probably wouldn't expose it directly to the Internet and rather put in behind a reverse proxy.

If you really wanted to expose your server to anyone, you need to tell the HTTP server to accept connections from all IPs with ANY_IP_V4 instead of LOOPBACK_IP_V4:

var addr = InternetAddress.ANY_IP_V4

This also applies to WebSockets servers.

Accessing Dart servers via Apache or nginx reverse proxies lets you stay with LOOPBACK_IP_V4 (127.0.0.1, aka localhost), which is generally safer.

Using Apache as a proxy for the Dart HTTP server

As we said, we can use Apache to serve all static content and proxy all nonstatic requests to the Dart HTTP server. You can modify your hosts file to point dart.localhost to 127.0.0.1 if you're already using virtual hosts on your computer and add a new directive to the Apache configuration:

<VirtualHost *:80>
  DocumentRoot "/project/path/Chapter_07_route_http_server/public...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
DART Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon