簡體   English   中英

如何為Dart Web Services運行localhost服務器(錯誤查找本地Web服務)

[英]How to run the localhost server for Dart Web Services (error finding local web service)

我在這里關注dart web服務教程: http//www.dartlang.org/articles/json-web-service/

當我嘗試從相關的git代碼運行代碼時https://github.com/chrisbu/dartlang_json_webservice_article_code

我收到以下錯誤。

Loading structured data
Failed to load resource
  http://127.0.0.1:8080/programming-languages
Uncaught Error: Instance of 'HttpRequestProgressEvent'
Exception: Instance of 'HttpRequestProgressEvent'

來自自述文件https://github.com/chrisbu/dartlang_json_webservice_article_code/blob/master/README.md

它表明我需要

To execute, either run:

dart simpleserver.dart
Load the project into the Dart Editor, and click "Run"

This starts the server listening on http://localhost:8080

我在哪里需要運行

dart simpleserver.dart

命令? 我可能缺少任何其他本地服務器設置要求嗎? 謝謝,(Windows 8專業版)

如果我在瀏覽器中運行客戶端而不先啟動服務器,我可以重現您的錯誤消息。 如您所包含的文檔中所述(但似乎不太了解),您可以通過兩種方式運行服務器:從命令行或從Dart編輯器。 如果您正在使用Dart編輯器:

  1. 在Dart編輯器中加載simpleserver/simpleserver.dart ,然后單擊“運行”按鈕。
  2. 在Dart編輯器中加載json_clien/web/json_client.dart ,然后單擊“運行”按鈕。

這將在捆綁的Dartium瀏覽器中加載json_client.html ,一切都應該有效。

如果您更喜歡使用命令行(聽起來不是這樣 ),請導航到simpleserver目錄,然后運行dart simpleserver.dart 然后在Dartium中手動加載json_clien/web/json_client.html json_client.html。

這兩種方式都適用於Linux上的Dart 0.5.13.1_r23552。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM