Dart是否支持服务器端开发? [英] Will Dart support server side development?

查看:2465
本文介绍了Dart是否支持服务器端开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们能不能在客户端/浏览器上使用dart,还可以在我们的服务器上使用dart?

Are we going to be able to use dart not only on the client/browser, but also on our server?

为服务器编写一些代码。 Apache,接受浏览器请求,查询数据库并向浏览器返回响应?可能是创建网络服务?

Write some code for a server e.g. Apache, accept browser requests, query a database and return a response to browser? Maybe create web services?

编辑:此处是指向服务器端Dart已确认:

Edit: here is the link to a video where server side Dart is confirmed:


http://news.dartlang.org/2012/03/video-josh-bloch-talks-about-dart.html [min 36: 00]

http://news.dartlang.org/2012/03/video-josh-bloch-talks-about-dart.html [min 36:00]


推荐答案

简短答案

更长的答案。 Dart VM已包含HTTP聊天服务器示例,该示例说明如何使用 dart:io HTTP API实现Web服务。一般来说, dart:io 库包含用于服务器端编程的功能,例如套接字和文件/目录处理。

Longer answer. The Dart VM already contains a HTTP chat server example that shows how to use the dart:io HTTP API to implement a web service. In general the dart:io library contains functionality that is meant to be used in server side programming such as sockets and file/directory handling.

它还是很早的阶段,但现在你可以玩一些早期尝试使用Dart SDK实现连接/节点样式应用程序。

Its still very early stage but already now you can play around with some early attempts of implementing connect/node style applications using the Dart SDK.

对于客户端和服务器之间的通信,您必须使用传统的REST / HTTP机制,但在将来(当在Dart中实现反射时)能够序列化实际的Dart对象,从而在客户端和服务器之间共享它们。

As for communicating between the client and the server you will have to use classic REST/HTTP mechanisms, but in the future (when reflection is implemented in Dart) you will be able to serialize actual Dart objects and thus share them between the client and server.

这篇关于Dart是否支持服务器端开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆