Dart最佳实践开发和生产 [英] Dart best practices for develop and production

查看:142
本文介绍了Dart最佳实践开发和生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这是一个noop问题,但我是DART的新。
我想知道是否有人在node.js环境中有关于开发和调试Dart应用程序的最佳实践的良好链接或想法。我可以启动一个独立的Dart应用程序,并使用绝对url调用rest api,但我认为Dart应用程序应该使用node.js和urls应该是相对的。在生产中我们还需要提供js编译的应用程序。

Sorry if this is a noop question, but I'm pretty new to Dart. I wonder if someone has good links or ideas for best practices for develop and debug a Dart application in a node.js environment. I can start a standalone Dart app and call a rest api using absolute url, but I think the Dart app should be served using node.js and the urls should be relative. In production we also need to serve the js compiled app. Do you know how to build a good development environment, near to production?

推荐答案

您可以在DartEditor中创建一个启动配置能够使用调试器与另一个Web服务器。
https://code.google.com/p/dart / issues / detail?id = 3748 (抱歉找不到更好的资源)

You can create a launch configuration in DartEditor to be able to use the debugger with another web server. https://code.google.com/p/dart/issues/detail?id=3748 (sorry couldn't find a better ressource)

Dartium内建的侦错工具

The Dartium built in debugger (Chrome developer tools) works pretty well too with Dart.

c>

我想最好的开发是在node.js服务器中设置Access-Control-Allow-Origin头,并使用DartEditor中内置的Web服务器开发(dart:调试dart客户端和现有休眠API的客户端/服务器通信?)。

用于在环境中测试和修复错误类似于部署环境使用上述配置。

Dart就像服务器的静态文件一样。当你不使用node.js来服务Dart时,你不会松动。

I guess the best for development is to set Access-Control-Allow-Origin header in your node.js server and develop with the web server built in in DartEditor (dart: debugging client/server communication for dart client and existing rest api?).
For testing and bug-fixing in an environment similar to the deployment environment use the configuration described above.
Dart is just like static files for the server. You don't loose much when you don't use node.js for serving Dart.

这篇关于Dart最佳实践开发和生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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